2012-08-19 12:33:25 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
|
|
|
|
#include "ImageContainer.h"
|
2013-08-11 16:17:23 -07:00
|
|
|
#include <string.h> // for memcpy, memset
|
2014-09-17 06:13:29 -07:00
|
|
|
#include "GLImages.h" // for SurfaceTextureImage
|
2013-12-13 09:32:02 -08:00
|
|
|
#include "gfx2DGlue.h"
|
2013-08-11 16:17:23 -07:00
|
|
|
#include "gfxPlatform.h" // for gfxPlatform
|
|
|
|
#include "gfxUtils.h" // for gfxUtils
|
|
|
|
#include "mozilla/RefPtr.h" // for TemporaryRef
|
|
|
|
#include "mozilla/ipc/CrossProcessMutex.h" // for CrossProcessMutex, etc
|
|
|
|
#include "mozilla/layers/CompositorTypes.h"
|
|
|
|
#include "mozilla/layers/ImageBridgeChild.h" // for ImageBridgeChild
|
|
|
|
#include "mozilla/layers/ImageClient.h" // for ImageClient
|
|
|
|
#include "nsISupportsUtils.h" // for NS_IF_ADDREF
|
2013-12-13 09:32:02 -08:00
|
|
|
#include "YCbCrUtils.h" // for YCbCr conversions
|
2013-08-11 16:17:23 -07:00
|
|
|
#ifdef MOZ_WIDGET_GONK
|
2012-08-21 03:22:58 -07:00
|
|
|
#include "GrallocImages.h"
|
2014-12-19 13:42:19 -08:00
|
|
|
#endif
|
2014-12-23 22:04:07 -08:00
|
|
|
#if defined(MOZ_WIDGET_GONK) && defined(MOZ_B2G_CAMERA) && defined(MOZ_WEBRTC)
|
2014-12-17 20:42:00 -08:00
|
|
|
#include "GonkCameraImage.h"
|
2013-08-11 16:17:23 -07:00
|
|
|
#endif
|
2014-01-15 07:06:43 -08:00
|
|
|
#include "gfx2DGlue.h"
|
2014-02-16 14:23:39 -08:00
|
|
|
#include "mozilla/gfx/2D.h"
|
2012-08-19 12:33:25 -07:00
|
|
|
|
|
|
|
#ifdef XP_MACOSX
|
|
|
|
#include "mozilla/gfx/QuartzSupport.h"
|
2013-10-31 18:54:14 -07:00
|
|
|
#include "MacIOSurfaceImage.h"
|
2012-08-19 12:33:25 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef XP_WIN
|
|
|
|
#include "gfxD2DSurface.h"
|
|
|
|
#include "gfxWindowsPlatform.h"
|
|
|
|
#include <d3d10_1.h>
|
2013-05-04 03:12:40 -07:00
|
|
|
#include "D3D9SurfaceImage.h"
|
2015-03-30 22:21:15 -07:00
|
|
|
#include "D3D11ShareHandleImage.h"
|
2012-08-19 12:33:25 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace layers {
|
|
|
|
|
2014-05-22 03:11:45 -07:00
|
|
|
using namespace mozilla::ipc;
|
|
|
|
using namespace android;
|
|
|
|
using namespace mozilla::gfx;
|
2013-08-11 16:17:23 -07:00
|
|
|
|
2013-08-12 02:51:49 -07:00
|
|
|
Atomic<int32_t> Image::sSerialCounter(0);
|
2012-08-22 17:08:26 -07:00
|
|
|
|
2012-08-19 12:33:25 -07:00
|
|
|
already_AddRefed<Image>
|
2014-01-30 14:58:51 -08:00
|
|
|
ImageFactory::CreateImage(ImageFormat aFormat,
|
2013-12-13 09:32:02 -08:00
|
|
|
const gfx::IntSize &,
|
2012-08-19 12:33:25 -07:00
|
|
|
BufferRecycleBin *aRecycleBin)
|
|
|
|
{
|
|
|
|
nsRefPtr<Image> img;
|
2012-08-21 03:22:58 -07:00
|
|
|
#ifdef MOZ_WIDGET_GONK
|
2014-01-30 14:58:51 -08:00
|
|
|
if (aFormat == ImageFormat::GRALLOC_PLANAR_YCBCR) {
|
2013-07-24 19:13:35 -07:00
|
|
|
img = new GrallocImage();
|
2012-08-21 03:22:58 -07:00
|
|
|
return img.forget();
|
|
|
|
}
|
2014-08-18 19:14:00 -07:00
|
|
|
if (aFormat == ImageFormat::OVERLAY_IMAGE) {
|
|
|
|
img = new OverlayImage();
|
|
|
|
return img.forget();
|
|
|
|
}
|
2014-12-19 13:42:19 -08:00
|
|
|
#endif
|
2014-12-23 22:04:07 -08:00
|
|
|
#if defined(MOZ_WIDGET_GONK) && defined(MOZ_B2G_CAMERA) && defined(MOZ_WEBRTC)
|
2014-12-17 20:42:00 -08:00
|
|
|
if (aFormat == ImageFormat::GONK_CAMERA_IMAGE) {
|
|
|
|
img = new GonkCameraImage();
|
|
|
|
return img.forget();
|
|
|
|
}
|
2012-08-21 03:22:58 -07:00
|
|
|
#endif
|
2014-01-30 14:58:51 -08:00
|
|
|
if (aFormat == ImageFormat::PLANAR_YCBCR) {
|
2012-08-19 12:33:25 -07:00
|
|
|
img = new PlanarYCbCrImage(aRecycleBin);
|
2012-08-21 03:22:58 -07:00
|
|
|
return img.forget();
|
|
|
|
}
|
2014-01-30 14:58:51 -08:00
|
|
|
if (aFormat == ImageFormat::CAIRO_SURFACE) {
|
2012-08-19 12:33:25 -07:00
|
|
|
img = new CairoImage();
|
2012-08-21 03:22:58 -07:00
|
|
|
return img.forget();
|
|
|
|
}
|
2014-09-17 06:13:29 -07:00
|
|
|
#ifdef MOZ_WIDGET_ANDROID
|
|
|
|
if (aFormat == ImageFormat::SURFACE_TEXTURE) {
|
|
|
|
img = new SurfaceTextureImage();
|
|
|
|
return img.forget();
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
if (aFormat == ImageFormat::EGLIMAGE) {
|
|
|
|
img = new EGLImageImage();
|
2012-08-21 03:22:58 -07:00
|
|
|
return img.forget();
|
|
|
|
}
|
2013-10-31 18:54:14 -07:00
|
|
|
#ifdef XP_MACOSX
|
2014-01-30 14:58:51 -08:00
|
|
|
if (aFormat == ImageFormat::MAC_IOSURFACE) {
|
2013-10-31 18:54:14 -07:00
|
|
|
img = new MacIOSurfaceImage();
|
|
|
|
return img.forget();
|
|
|
|
}
|
|
|
|
#endif
|
2013-05-04 03:12:40 -07:00
|
|
|
#ifdef XP_WIN
|
2015-03-30 22:21:15 -07:00
|
|
|
if (aFormat == ImageFormat::D3D11_SHARE_HANDLE_TEXTURE) {
|
|
|
|
img = new D3D11ShareHandleImage();
|
|
|
|
return img.forget();
|
|
|
|
}
|
2014-01-30 14:58:51 -08:00
|
|
|
if (aFormat == ImageFormat::D3D9_RGB32_TEXTURE) {
|
2013-05-04 03:12:40 -07:00
|
|
|
img = new D3D9SurfaceImage();
|
|
|
|
return img.forget();
|
|
|
|
}
|
2012-08-21 03:22:58 -07:00
|
|
|
#endif
|
|
|
|
return nullptr;
|
2012-08-19 12:33:25 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
BufferRecycleBin::BufferRecycleBin()
|
|
|
|
: mLock("mozilla.layers.BufferRecycleBin.mLock")
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2012-08-22 08:56:38 -07:00
|
|
|
BufferRecycleBin::RecycleBuffer(uint8_t* aBuffer, uint32_t aSize)
|
2012-08-19 12:33:25 -07:00
|
|
|
{
|
|
|
|
MutexAutoLock lock(mLock);
|
|
|
|
|
|
|
|
if (!mRecycledBuffers.IsEmpty() && aSize != mRecycledBufferSize) {
|
|
|
|
mRecycledBuffers.Clear();
|
|
|
|
}
|
|
|
|
mRecycledBufferSize = aSize;
|
|
|
|
mRecycledBuffers.AppendElement(aBuffer);
|
|
|
|
}
|
|
|
|
|
2012-08-22 08:56:38 -07:00
|
|
|
uint8_t*
|
|
|
|
BufferRecycleBin::GetBuffer(uint32_t aSize)
|
2012-08-19 12:33:25 -07:00
|
|
|
{
|
|
|
|
MutexAutoLock lock(mLock);
|
|
|
|
|
|
|
|
if (mRecycledBuffers.IsEmpty() || mRecycledBufferSize != aSize)
|
2012-08-22 08:56:38 -07:00
|
|
|
return new uint8_t[aSize];
|
2012-08-19 12:33:25 -07:00
|
|
|
|
2012-08-22 08:56:38 -07:00
|
|
|
uint32_t last = mRecycledBuffers.Length() - 1;
|
|
|
|
uint8_t* result = mRecycledBuffers[last].forget();
|
2012-08-19 12:33:25 -07:00
|
|
|
mRecycledBuffers.RemoveElementAt(last);
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
ImageContainer::ImageContainer(int flag)
|
2012-08-19 12:33:25 -07:00
|
|
|
: mReentrantMonitor("ImageContainer.mReentrantMonitor"),
|
|
|
|
mPaintCount(0),
|
|
|
|
mPreviousImagePainted(false),
|
|
|
|
mImageFactory(new ImageFactory()),
|
|
|
|
mRecycleBin(new BufferRecycleBin()),
|
|
|
|
mCompositionNotifySink(nullptr),
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
mImageClient(nullptr)
|
2012-08-19 12:33:25 -07:00
|
|
|
{
|
|
|
|
if (flag == ENABLE_ASYNC && ImageBridgeChild::IsCreated()) {
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
// the refcount of this ImageClient is 1. we don't use a RefPtr here because the refcount
|
|
|
|
// of this class must be done on the ImageBridge thread.
|
2014-12-30 15:42:48 -08:00
|
|
|
mImageClient = ImageBridgeChild::GetSingleton()->CreateImageClient(CompositableType::IMAGE).take();
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
MOZ_ASSERT(mImageClient);
|
2012-08-19 12:33:25 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ImageContainer::~ImageContainer()
|
|
|
|
{
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
if (IsAsync()) {
|
|
|
|
ImageBridgeChild::DispatchReleaseImageClient(mImageClient);
|
2012-08-19 12:33:25 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
already_AddRefed<Image>
|
2014-01-30 14:58:51 -08:00
|
|
|
ImageContainer::CreateImage(ImageFormat aFormat)
|
2012-08-19 12:33:25 -07:00
|
|
|
{
|
|
|
|
ReentrantMonitorAutoEnter mon(mReentrantMonitor);
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
|
2014-08-18 19:14:00 -07:00
|
|
|
#ifdef MOZ_WIDGET_GONK
|
|
|
|
if (aFormat == ImageFormat::OVERLAY_IMAGE) {
|
|
|
|
if (mImageClient && mImageClient->GetTextureInfo().mCompositableType != CompositableType::IMAGE_OVERLAY) {
|
|
|
|
// If this ImageContainer is async but the image type mismatch, fix it here
|
|
|
|
if (ImageBridgeChild::IsCreated()) {
|
|
|
|
ImageBridgeChild::DispatchReleaseImageClient(mImageClient);
|
2014-12-30 15:42:48 -08:00
|
|
|
mImageClient = ImageBridgeChild::GetSingleton()->CreateImageClient(CompositableType::IMAGE_OVERLAY).take();
|
2014-08-18 19:14:00 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
if (mImageClient) {
|
2014-01-30 14:58:51 -08:00
|
|
|
nsRefPtr<Image> img = mImageClient->CreateImage(aFormat);
|
2012-11-05 02:38:03 -08:00
|
|
|
if (img) {
|
|
|
|
return img.forget();
|
|
|
|
}
|
|
|
|
}
|
2014-01-30 14:58:51 -08:00
|
|
|
return mImageFactory->CreateImage(aFormat, mScaleHint, mRecycleBin);
|
2012-08-19 12:33:25 -07:00
|
|
|
}
|
|
|
|
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
void
|
2012-08-19 12:33:25 -07:00
|
|
|
ImageContainer::SetCurrentImageInternal(Image *aImage)
|
|
|
|
{
|
|
|
|
ReentrantMonitorAutoEnter mon(mReentrantMonitor);
|
|
|
|
|
|
|
|
mActiveImage = aImage;
|
|
|
|
CurrentImageChanged();
|
|
|
|
}
|
|
|
|
|
2013-09-12 07:50:28 -07:00
|
|
|
void
|
|
|
|
ImageContainer::ClearCurrentImage()
|
|
|
|
{
|
|
|
|
ReentrantMonitorAutoEnter mon(mReentrantMonitor);
|
|
|
|
SetCurrentImageInternal(nullptr);
|
|
|
|
}
|
|
|
|
|
2012-08-19 12:33:25 -07:00
|
|
|
void
|
|
|
|
ImageContainer::SetCurrentImage(Image *aImage)
|
|
|
|
{
|
2013-10-17 08:09:15 -07:00
|
|
|
if (!aImage) {
|
|
|
|
ClearAllImages();
|
2013-09-12 07:50:28 -07:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2012-08-19 12:33:25 -07:00
|
|
|
ReentrantMonitorAutoEnter mon(mReentrantMonitor);
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
if (IsAsync()) {
|
2013-09-12 07:50:28 -07:00
|
|
|
ImageBridgeChild::DispatchImageClientUpdate(mImageClient, this);
|
2012-08-19 12:33:25 -07:00
|
|
|
}
|
|
|
|
SetCurrentImageInternal(aImage);
|
|
|
|
}
|
|
|
|
|
2013-10-17 08:09:15 -07:00
|
|
|
void
|
|
|
|
ImageContainer::ClearAllImages()
|
|
|
|
{
|
|
|
|
if (IsAsync()) {
|
|
|
|
// Let ImageClient release all TextureClients.
|
|
|
|
ImageBridgeChild::FlushAllImages(mImageClient, this, false);
|
|
|
|
return;
|
|
|
|
}
|
2013-12-11 17:44:45 -08:00
|
|
|
|
2013-10-17 08:09:15 -07:00
|
|
|
ReentrantMonitorAutoEnter mon(mReentrantMonitor);
|
|
|
|
SetCurrentImageInternal(nullptr);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
ImageContainer::ClearAllImagesExceptFront()
|
|
|
|
{
|
|
|
|
if (IsAsync()) {
|
|
|
|
// Let ImageClient release all TextureClients except front one.
|
|
|
|
ImageBridgeChild::FlushAllImages(mImageClient, this, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-08-19 12:33:25 -07:00
|
|
|
void
|
|
|
|
ImageContainer::SetCurrentImageInTransaction(Image *aImage)
|
|
|
|
{
|
|
|
|
NS_ASSERTION(NS_IsMainThread(), "Should be on main thread.");
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
NS_ASSERTION(!mImageClient, "Should use async image transfer with ImageBridge.");
|
|
|
|
|
2012-08-19 12:33:25 -07:00
|
|
|
SetCurrentImageInternal(aImage);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool ImageContainer::IsAsync() const {
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
return mImageClient != nullptr;
|
2012-08-19 12:33:25 -07:00
|
|
|
}
|
|
|
|
|
2012-08-22 08:56:38 -07:00
|
|
|
uint64_t ImageContainer::GetAsyncContainerID() const
|
2012-08-19 12:33:25 -07:00
|
|
|
{
|
|
|
|
NS_ASSERTION(IsAsync(),"Shared image ID is only relevant to async ImageContainers");
|
|
|
|
if (IsAsync()) {
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
return mImageClient->GetAsyncID();
|
2012-08-19 12:33:25 -07:00
|
|
|
} else {
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
return 0; // zero is always an invalid AsyncID
|
2012-08-19 12:33:25 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
ImageContainer::HasCurrentImage()
|
|
|
|
{
|
|
|
|
ReentrantMonitorAutoEnter mon(mReentrantMonitor);
|
|
|
|
|
|
|
|
return !!mActiveImage.get();
|
|
|
|
}
|
|
|
|
|
|
|
|
already_AddRefed<Image>
|
|
|
|
ImageContainer::LockCurrentImage()
|
|
|
|
{
|
|
|
|
ReentrantMonitorAutoEnter mon(mReentrantMonitor);
|
2014-07-11 13:50:23 -07:00
|
|
|
|
2012-08-19 12:33:25 -07:00
|
|
|
nsRefPtr<Image> retval = mActiveImage;
|
|
|
|
return retval.forget();
|
|
|
|
}
|
|
|
|
|
2014-01-15 07:06:43 -08:00
|
|
|
TemporaryRef<gfx::SourceSurface>
|
|
|
|
ImageContainer::LockCurrentAsSourceSurface(gfx::IntSize *aSize, Image** aCurrentImage)
|
|
|
|
{
|
|
|
|
ReentrantMonitorAutoEnter mon(mReentrantMonitor);
|
|
|
|
|
|
|
|
if (aCurrentImage) {
|
2014-12-25 12:18:38 -08:00
|
|
|
nsRefPtr<Image> activeImage(mActiveImage);
|
|
|
|
activeImage.forget(aCurrentImage);
|
2014-01-15 07:06:43 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!mActiveImage) {
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
*aSize = mActiveImage->GetSize();
|
|
|
|
return mActiveImage->GetAsSourceSurface();
|
|
|
|
}
|
|
|
|
|
2012-08-19 12:33:25 -07:00
|
|
|
void
|
|
|
|
ImageContainer::UnlockCurrentImage()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2014-01-15 07:06:43 -08:00
|
|
|
TemporaryRef<gfx::SourceSurface>
|
|
|
|
ImageContainer::GetCurrentAsSourceSurface(gfx::IntSize *aSize)
|
|
|
|
{
|
|
|
|
ReentrantMonitorAutoEnter mon(mReentrantMonitor);
|
|
|
|
|
2014-09-24 13:35:06 -07:00
|
|
|
if (!mActiveImage)
|
|
|
|
return nullptr;
|
|
|
|
*aSize = mActiveImage->GetSize();
|
2014-01-15 07:06:43 -08:00
|
|
|
return mActiveImage->GetAsSourceSurface();
|
|
|
|
}
|
|
|
|
|
2013-12-13 09:32:02 -08:00
|
|
|
gfx::IntSize
|
2012-08-19 12:33:25 -07:00
|
|
|
ImageContainer::GetCurrentSize()
|
|
|
|
{
|
|
|
|
ReentrantMonitorAutoEnter mon(mReentrantMonitor);
|
|
|
|
|
|
|
|
if (!mActiveImage) {
|
2013-12-31 01:06:12 -08:00
|
|
|
return gfx::IntSize(0, 0);
|
2012-08-19 12:33:25 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
return mActiveImage->GetSize();
|
|
|
|
}
|
|
|
|
|
|
|
|
PlanarYCbCrImage::PlanarYCbCrImage(BufferRecycleBin *aRecycleBin)
|
2014-01-30 14:58:49 -08:00
|
|
|
: Image(nullptr, ImageFormat::PLANAR_YCBCR)
|
2012-08-19 12:33:25 -07:00
|
|
|
, mBufferSize(0)
|
2014-01-23 10:26:40 -08:00
|
|
|
, mOffscreenFormat(gfxImageFormat::Unknown)
|
2012-08-19 12:33:25 -07:00
|
|
|
, mRecycleBin(aRecycleBin)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
PlanarYCbCrImage::~PlanarYCbCrImage()
|
|
|
|
{
|
|
|
|
if (mBuffer) {
|
|
|
|
mRecycleBin->RecycleBuffer(mBuffer.forget(), mBufferSize);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-03-19 14:33:12 -07:00
|
|
|
size_t
|
|
|
|
PlanarYCbCrImage::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
|
|
|
|
{
|
|
|
|
// Ignoring:
|
|
|
|
// - mData - just wraps mBuffer
|
|
|
|
// - Surfaces should be reported under gfx-surfaces-*:
|
|
|
|
// - mSourceSurface
|
|
|
|
// - Base class:
|
|
|
|
// - mImplData is not used
|
|
|
|
// Not owned:
|
|
|
|
// - mRecycleBin
|
|
|
|
size_t size = mBuffer.SizeOfExcludingThis(aMallocSizeOf);
|
|
|
|
|
|
|
|
// Could add in the future:
|
|
|
|
// - mBackendData (from base class)
|
|
|
|
|
|
|
|
return size;
|
|
|
|
}
|
|
|
|
|
2014-07-11 13:50:23 -07:00
|
|
|
uint8_t*
|
2012-08-22 08:56:38 -07:00
|
|
|
PlanarYCbCrImage::AllocateBuffer(uint32_t aSize)
|
2012-08-19 12:33:25 -07:00
|
|
|
{
|
2014-07-11 13:50:23 -07:00
|
|
|
return mRecycleBin->GetBuffer(aSize);
|
2012-08-19 12:33:25 -07:00
|
|
|
}
|
|
|
|
|
2012-08-23 10:01:14 -07:00
|
|
|
static void
|
2012-09-04 10:10:06 -07:00
|
|
|
CopyPlane(uint8_t *aDst, const uint8_t *aSrc,
|
2013-12-20 08:46:29 -08:00
|
|
|
const gfx::IntSize &aSize, int32_t aStride, int32_t aSkip)
|
2012-08-23 10:01:14 -07:00
|
|
|
{
|
2012-08-25 20:22:51 -07:00
|
|
|
if (!aSkip) {
|
2012-08-23 10:01:14 -07:00
|
|
|
// Fast path: planar input.
|
|
|
|
memcpy(aDst, aSrc, aSize.height * aStride);
|
|
|
|
} else {
|
|
|
|
int32_t height = aSize.height;
|
|
|
|
int32_t width = aSize.width;
|
|
|
|
for (int y = 0; y < height; ++y) {
|
2012-09-04 10:10:06 -07:00
|
|
|
const uint8_t *src = aSrc;
|
2012-08-23 10:01:14 -07:00
|
|
|
uint8_t *dst = aDst;
|
2012-08-25 20:22:51 -07:00
|
|
|
// Slow path
|
|
|
|
for (int x = 0; x < width; ++x) {
|
|
|
|
*dst++ = *src++;
|
|
|
|
src += aSkip;
|
2012-08-23 10:01:14 -07:00
|
|
|
}
|
2012-09-04 10:10:06 -07:00
|
|
|
aSrc += aStride;
|
|
|
|
aDst += aStride;
|
2012-08-23 10:01:14 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
PlanarYCbCrImage::CopyData(const Data& aData)
|
2012-08-19 12:33:25 -07:00
|
|
|
{
|
2012-08-23 10:01:14 -07:00
|
|
|
mData = aData;
|
|
|
|
|
2012-08-19 12:33:25 -07:00
|
|
|
// update buffer size
|
2013-12-10 22:58:51 -08:00
|
|
|
size_t size = mData.mCbCrStride * mData.mCbCrSize.height * 2 +
|
2012-08-23 10:01:14 -07:00
|
|
|
mData.mYStride * mData.mYSize.height;
|
|
|
|
|
2012-08-19 12:33:25 -07:00
|
|
|
// get new buffer
|
2013-12-10 22:58:51 -08:00
|
|
|
mBuffer = AllocateBuffer(size);
|
2012-08-23 10:01:14 -07:00
|
|
|
if (!mBuffer)
|
2012-08-19 12:33:25 -07:00
|
|
|
return;
|
|
|
|
|
2013-12-10 22:58:51 -08:00
|
|
|
// update buffer size
|
|
|
|
mBufferSize = size;
|
|
|
|
|
2012-08-23 10:01:14 -07:00
|
|
|
mData.mYChannel = mBuffer;
|
|
|
|
mData.mCbChannel = mData.mYChannel + mData.mYStride * mData.mYSize.height;
|
|
|
|
mData.mCrChannel = mData.mCbChannel + mData.mCbCrStride * mData.mCbCrSize.height;
|
|
|
|
|
|
|
|
CopyPlane(mData.mYChannel, aData.mYChannel,
|
2012-08-25 20:22:51 -07:00
|
|
|
mData.mYSize, mData.mYStride, mData.mYSkip);
|
2012-08-23 10:01:14 -07:00
|
|
|
CopyPlane(mData.mCbChannel, aData.mCbChannel,
|
2012-08-25 20:22:51 -07:00
|
|
|
mData.mCbCrSize, mData.mCbCrStride, mData.mCbSkip);
|
2012-08-23 10:01:14 -07:00
|
|
|
CopyPlane(mData.mCrChannel, aData.mCrChannel,
|
2012-08-25 20:22:51 -07:00
|
|
|
mData.mCbCrSize, mData.mCbCrStride, mData.mCrSkip);
|
2012-08-23 10:01:14 -07:00
|
|
|
|
|
|
|
mSize = aData.mPicSize;
|
2012-08-19 12:33:25 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
PlanarYCbCrImage::SetData(const Data &aData)
|
|
|
|
{
|
2012-08-23 10:01:14 -07:00
|
|
|
CopyData(aData);
|
2012-08-19 12:33:25 -07:00
|
|
|
}
|
|
|
|
|
2013-09-24 13:45:13 -07:00
|
|
|
gfxImageFormat
|
2013-01-23 15:08:16 -08:00
|
|
|
PlanarYCbCrImage::GetOffscreenFormat()
|
|
|
|
{
|
2014-01-23 10:26:40 -08:00
|
|
|
return mOffscreenFormat == gfxImageFormat::Unknown ?
|
2013-01-23 15:08:16 -08:00
|
|
|
gfxPlatform::GetPlatform()->GetOffscreenFormat() :
|
|
|
|
mOffscreenFormat;
|
|
|
|
}
|
|
|
|
|
2013-03-13 13:11:15 -07:00
|
|
|
void
|
|
|
|
PlanarYCbCrImage::SetDataNoCopy(const Data &aData)
|
|
|
|
{
|
|
|
|
mData = aData;
|
|
|
|
mSize = aData.mPicSize;
|
|
|
|
}
|
|
|
|
|
|
|
|
uint8_t*
|
|
|
|
PlanarYCbCrImage::AllocateAndGetNewBuffer(uint32_t aSize)
|
|
|
|
{
|
|
|
|
// get new buffer
|
2013-12-10 22:58:51 -08:00
|
|
|
mBuffer = AllocateBuffer(aSize);
|
|
|
|
if (mBuffer) {
|
|
|
|
// update buffer size
|
|
|
|
mBufferSize = aSize;
|
|
|
|
}
|
2013-03-13 13:11:15 -07:00
|
|
|
return mBuffer;
|
|
|
|
}
|
|
|
|
|
2014-01-21 08:49:53 -08:00
|
|
|
TemporaryRef<gfx::SourceSurface>
|
|
|
|
PlanarYCbCrImage::GetAsSourceSurface()
|
|
|
|
{
|
|
|
|
if (mSourceSurface) {
|
2015-04-30 12:20:30 -07:00
|
|
|
RefPtr<gfx::SourceSurface> surface(mSourceSurface);
|
|
|
|
return surface.forget();
|
2014-01-21 08:49:53 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
gfx::IntSize size(mSize);
|
|
|
|
gfx::SurfaceFormat format = gfx::ImageFormatToSurfaceFormat(GetOffscreenFormat());
|
|
|
|
gfx::GetYCbCrToRGBDestFormatAndSize(mData, format, size);
|
|
|
|
if (mSize.width > PlanarYCbCrImage::MAX_DIMENSION ||
|
|
|
|
mSize.height > PlanarYCbCrImage::MAX_DIMENSION) {
|
|
|
|
NS_ERROR("Illegal image dest width or height");
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
RefPtr<gfx::DataSourceSurface> surface = gfx::Factory::CreateDataSourceSurface(size, format);
|
2014-08-27 08:57:43 -07:00
|
|
|
if (NS_WARN_IF(!surface)) {
|
2014-06-16 16:47:28 -07:00
|
|
|
return nullptr;
|
|
|
|
}
|
2014-01-21 08:49:53 -08:00
|
|
|
|
|
|
|
gfx::ConvertYCbCrToRGB(mData, format, size, surface->GetData(), surface->Stride());
|
|
|
|
|
|
|
|
mSourceSurface = surface;
|
|
|
|
|
|
|
|
return surface.forget();
|
|
|
|
}
|
|
|
|
|
2014-02-16 14:23:39 -08:00
|
|
|
CairoImage::CairoImage()
|
|
|
|
: Image(nullptr, ImageFormat::CAIRO_SURFACE)
|
|
|
|
{}
|
|
|
|
|
|
|
|
CairoImage::~CairoImage()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
TextureClient*
|
|
|
|
CairoImage::GetTextureClient(CompositableClient *aClient)
|
|
|
|
{
|
2014-05-06 05:34:19 -07:00
|
|
|
if (!aClient) {
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
2014-02-16 14:23:39 -08:00
|
|
|
CompositableForwarder* forwarder = aClient->GetForwarder();
|
|
|
|
RefPtr<TextureClient> textureClient = mTextureClients.Get(forwarder->GetSerial());
|
|
|
|
if (textureClient) {
|
|
|
|
return textureClient;
|
|
|
|
}
|
|
|
|
|
|
|
|
RefPtr<SourceSurface> surface = GetAsSourceSurface();
|
|
|
|
MOZ_ASSERT(surface);
|
2014-05-06 05:34:19 -07:00
|
|
|
if (!surface) {
|
|
|
|
return nullptr;
|
|
|
|
}
|
2014-02-16 14:23:39 -08:00
|
|
|
|
2014-11-13 07:53:49 -08:00
|
|
|
|
|
|
|
// XXX windows' TextureClients do not hold ISurfaceAllocator,
|
|
|
|
// recycler does not work on windows.
|
|
|
|
#ifndef XP_WIN
|
|
|
|
|
|
|
|
// XXX only gonk ensure when TextureClient is recycled,
|
|
|
|
// TextureHost is not used by CompositableHost.
|
|
|
|
#ifdef MOZ_WIDGET_GONK
|
|
|
|
RefPtr<TextureClientRecycleAllocator> recycler =
|
|
|
|
aClient->GetTextureClientRecycler();
|
|
|
|
if (recycler) {
|
|
|
|
textureClient =
|
|
|
|
recycler->CreateOrRecycleForDrawing(surface->GetFormat(),
|
|
|
|
surface->GetSize(),
|
|
|
|
gfx::BackendType::NONE,
|
|
|
|
aClient->GetTextureFlags());
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|
|
|
|
if (!textureClient) {
|
|
|
|
// gfx::BackendType::NONE means default to content backend
|
|
|
|
textureClient = aClient->CreateTextureClientForDrawing(surface->GetFormat(),
|
|
|
|
surface->GetSize(),
|
|
|
|
gfx::BackendType::NONE,
|
|
|
|
TextureFlags::DEFAULT);
|
|
|
|
}
|
2014-05-06 05:34:19 -07:00
|
|
|
if (!textureClient) {
|
|
|
|
return nullptr;
|
|
|
|
}
|
2014-04-10 01:14:28 -07:00
|
|
|
MOZ_ASSERT(textureClient->CanExposeDrawTarget());
|
2014-07-10 04:45:40 -07:00
|
|
|
if (!textureClient->Lock(OpenMode::OPEN_WRITE_ONLY)) {
|
2014-02-16 14:23:39 -08:00
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
2014-06-11 10:33:37 -07:00
|
|
|
TextureClientAutoUnlock autoUnolck(textureClient);
|
2014-02-16 14:23:39 -08:00
|
|
|
{
|
|
|
|
// We must not keep a reference to the DrawTarget after it has been unlocked.
|
2014-06-11 11:57:58 -07:00
|
|
|
DrawTarget* dt = textureClient->BorrowDrawTarget();
|
2014-06-11 10:33:37 -07:00
|
|
|
if (!dt) {
|
|
|
|
return nullptr;
|
|
|
|
}
|
2014-02-16 14:23:39 -08:00
|
|
|
dt->CopySurface(surface, IntRect(IntPoint(), surface->GetSize()), IntPoint());
|
|
|
|
}
|
|
|
|
|
|
|
|
mTextureClients.Put(forwarder->GetSerial(), textureClient);
|
|
|
|
return textureClient;
|
|
|
|
}
|
|
|
|
|
2012-08-19 12:33:25 -07:00
|
|
|
} // namespace
|
2012-08-19 19:39:10 -07:00
|
|
|
} // namespace
|