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
|
|
|
/* -*- 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 "mozilla/layers/ContentHost.h"
|
2013-08-11 16:17:23 -07:00
|
|
|
#include "LayersLogging.h" // for AppendToString
|
|
|
|
#include "gfx2DGlue.h" // for ContentForFormat
|
2013-12-20 08:46:28 -08:00
|
|
|
#include "mozilla/gfx/Point.h" // for IntSize
|
2013-08-11 16:17:23 -07:00
|
|
|
#include "mozilla/Assertions.h" // for MOZ_ASSERT, etc
|
|
|
|
#include "mozilla/gfx/BaseRect.h" // for BaseRect
|
|
|
|
#include "mozilla/layers/Compositor.h" // for Compositor
|
|
|
|
#include "mozilla/layers/Effects.h" // for TexturedEffect, Effect, etc
|
2013-09-06 08:41:00 -07:00
|
|
|
#include "mozilla/layers/LayersMessages.h" // for ThebesBufferData
|
2013-08-11 16:17:23 -07:00
|
|
|
#include "nsAString.h"
|
|
|
|
#include "nsPrintfCString.h" // for nsPrintfCString
|
|
|
|
#include "nsString.h" // for nsAutoCString
|
2014-04-01 23:45:02 -07:00
|
|
|
#include "mozilla/layers/TextureHostOGL.h" // for TextureHostOGL
|
2013-08-11 16:17:23 -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
|
|
|
namespace mozilla {
|
2013-08-11 16:17:23 -07:00
|
|
|
namespace gfx {
|
|
|
|
class Matrix4x4;
|
|
|
|
}
|
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
|
|
|
using namespace gfx;
|
2013-08-11 16:17:23 -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
|
|
|
namespace layers {
|
|
|
|
|
2013-11-27 13:16:35 -08:00
|
|
|
ContentHostBase::ContentHostBase(const TextureInfo& aTextureInfo)
|
2013-11-27 13:16:34 -08:00
|
|
|
: ContentHost(aTextureInfo)
|
|
|
|
, mPaintWillResample(false)
|
|
|
|
, mInitialised(false)
|
|
|
|
{}
|
|
|
|
|
2013-11-27 13:16:35 -08:00
|
|
|
ContentHostBase::~ContentHostBase()
|
2013-12-05 10:39:22 -08:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2014-04-01 23:45:02 -07:00
|
|
|
struct AutoLockContentHost
|
2013-12-05 10:39:22 -08:00
|
|
|
{
|
2014-04-01 23:45:02 -07:00
|
|
|
AutoLockContentHost(ContentHostBase* aHost)
|
|
|
|
: mHost(aHost)
|
|
|
|
{
|
2014-04-01 23:45:02 -07:00
|
|
|
mSucceeded = mHost->Lock();
|
2014-04-01 23:45:02 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
~AutoLockContentHost()
|
|
|
|
{
|
2014-04-01 23:45:02 -07:00
|
|
|
if (mSucceeded) {
|
2014-04-01 23:45:02 -07:00
|
|
|
mHost->Unlock();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-04-01 23:45:02 -07:00
|
|
|
bool Failed() { return !mSucceeded; }
|
2014-04-01 23:45:02 -07:00
|
|
|
|
|
|
|
ContentHostBase* mHost;
|
2014-04-01 23:45:02 -07:00
|
|
|
bool mSucceeded;
|
2014-04-01 23:45:02 -07:00
|
|
|
};
|
2013-12-05 10:39:22 -08:00
|
|
|
|
|
|
|
void
|
|
|
|
ContentHostBase::Composite(EffectChain& aEffectChain,
|
|
|
|
float aOpacity,
|
|
|
|
const gfx::Matrix4x4& aTransform,
|
|
|
|
const Filter& aFilter,
|
|
|
|
const Rect& aClipRect,
|
|
|
|
const nsIntRegion* aVisibleRegion,
|
|
|
|
TiledLayerProperties* aLayerProperties)
|
|
|
|
{
|
|
|
|
NS_ASSERTION(aVisibleRegion, "Requires a visible region");
|
|
|
|
|
2014-04-01 23:45:02 -07:00
|
|
|
AutoLockContentHost lock(this);
|
|
|
|
if (lock.Failed()) {
|
2013-12-19 08:20:51 -08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2014-04-01 23:45:02 -07:00
|
|
|
RefPtr<NewTextureSource> source = GetTextureSource();
|
|
|
|
RefPtr<NewTextureSource> sourceOnWhite = GetTextureSourceOnWhite();
|
2013-12-05 10:39:22 -08:00
|
|
|
|
|
|
|
if (!source) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
RefPtr<TexturedEffect> effect =
|
2014-06-04 15:20:26 -07:00
|
|
|
CreateTexturedEffect(source, sourceOnWhite, aFilter, true);
|
2013-12-05 10:39:22 -08:00
|
|
|
|
2014-01-07 08:20:11 -08:00
|
|
|
if (!effect) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2013-12-05 10:39:22 -08:00
|
|
|
aEffectChain.mPrimaryEffect = effect;
|
|
|
|
|
|
|
|
nsIntRegion tmpRegion;
|
|
|
|
const nsIntRegion* renderRegion;
|
|
|
|
if (PaintWillResample()) {
|
|
|
|
// If we're resampling, then the texture image will contain exactly the
|
|
|
|
// entire visible region's bounds, and we should draw it all in one quad
|
|
|
|
// to avoid unexpected aliasing.
|
|
|
|
tmpRegion = aVisibleRegion->GetBounds();
|
|
|
|
renderRegion = &tmpRegion;
|
|
|
|
} else {
|
|
|
|
renderRegion = aVisibleRegion;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsIntRegion region(*renderRegion);
|
|
|
|
nsIntPoint origin = GetOriginOffset();
|
|
|
|
// translate into TexImage space, buffer origin might not be at texture (0,0)
|
|
|
|
region.MoveBy(-origin);
|
|
|
|
|
|
|
|
// Figure out the intersecting draw region
|
|
|
|
gfx::IntSize texSize = source->GetSize();
|
|
|
|
nsIntRect textureRect = nsIntRect(0, 0, texSize.width, texSize.height);
|
|
|
|
textureRect.MoveBy(region.GetBounds().TopLeft());
|
|
|
|
nsIntRegion subregion;
|
|
|
|
subregion.And(region, textureRect);
|
|
|
|
if (subregion.IsEmpty()) {
|
|
|
|
// Region is empty, nothing to draw
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsIntRegion screenRects;
|
|
|
|
nsIntRegion regionRects;
|
|
|
|
|
|
|
|
// Collect texture/screen coordinates for drawing
|
|
|
|
nsIntRegionRectIterator iter(subregion);
|
|
|
|
while (const nsIntRect* iterRect = iter.Next()) {
|
|
|
|
nsIntRect regionRect = *iterRect;
|
|
|
|
nsIntRect screenRect = regionRect;
|
|
|
|
screenRect.MoveBy(origin);
|
|
|
|
|
|
|
|
screenRects.Or(screenRects, screenRect);
|
|
|
|
regionRects.Or(regionRects, regionRect);
|
|
|
|
}
|
|
|
|
|
2014-04-28 04:27:25 -07:00
|
|
|
BigImageIterator* bigImgIter = source->AsBigImageIterator();
|
|
|
|
BigImageIterator* iterOnWhite = nullptr;
|
|
|
|
if (bigImgIter) {
|
|
|
|
bigImgIter->BeginBigImageIteration();
|
2013-12-05 10:39:22 -08:00
|
|
|
}
|
|
|
|
|
2014-01-23 06:14:58 -08:00
|
|
|
if (sourceOnWhite) {
|
2014-04-28 04:27:25 -07:00
|
|
|
iterOnWhite = sourceOnWhite->AsBigImageIterator();
|
|
|
|
MOZ_ASSERT(!bigImgIter || bigImgIter->GetTileCount() == iterOnWhite->GetTileCount(),
|
2013-12-05 10:39:22 -08:00
|
|
|
"Tile count mismatch on component alpha texture");
|
|
|
|
if (iterOnWhite) {
|
2014-04-28 04:27:25 -07:00
|
|
|
iterOnWhite->BeginBigImageIteration();
|
2013-12-05 10:39:22 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-04-28 04:27:25 -07:00
|
|
|
bool usingTiles = (bigImgIter && bigImgIter->GetTileCount() > 1);
|
2013-12-05 10:39:22 -08:00
|
|
|
do {
|
|
|
|
if (iterOnWhite) {
|
2014-04-28 04:27:25 -07:00
|
|
|
MOZ_ASSERT(iterOnWhite->GetTileRect() == bigImgIter->GetTileRect(),
|
2013-12-05 10:39:22 -08:00
|
|
|
"component alpha textures should be the same size.");
|
|
|
|
}
|
|
|
|
|
2014-04-28 04:27:25 -07:00
|
|
|
nsIntRect texRect = bigImgIter ? bigImgIter->GetTileRect()
|
2013-12-05 10:39:22 -08:00
|
|
|
: nsIntRect(0, 0,
|
|
|
|
texSize.width,
|
|
|
|
texSize.height);
|
|
|
|
|
|
|
|
// Draw texture. If we're using tiles, we do repeating manually, as texture
|
|
|
|
// repeat would cause each individual tile to repeat instead of the
|
|
|
|
// compound texture as a whole. This involves drawing at most 4 sections,
|
|
|
|
// 2 for each axis that has texture repeat.
|
|
|
|
for (int y = 0; y < (usingTiles ? 2 : 1); y++) {
|
|
|
|
for (int x = 0; x < (usingTiles ? 2 : 1); x++) {
|
|
|
|
nsIntRect currentTileRect(texRect);
|
|
|
|
currentTileRect.MoveBy(x * texSize.width, y * texSize.height);
|
|
|
|
|
|
|
|
nsIntRegionRectIterator screenIter(screenRects);
|
|
|
|
nsIntRegionRectIterator regionIter(regionRects);
|
|
|
|
|
|
|
|
const nsIntRect* screenRect;
|
|
|
|
const nsIntRect* regionRect;
|
|
|
|
while ((screenRect = screenIter.Next()) &&
|
|
|
|
(regionRect = regionIter.Next())) {
|
|
|
|
nsIntRect tileScreenRect(*screenRect);
|
|
|
|
nsIntRect tileRegionRect(*regionRect);
|
|
|
|
|
|
|
|
// When we're using tiles, find the intersection between the tile
|
|
|
|
// rect and this region rect. Tiling is then handled by the
|
|
|
|
// outer for-loops and modifying the tile rect.
|
|
|
|
if (usingTiles) {
|
|
|
|
tileScreenRect.MoveBy(-origin);
|
|
|
|
tileScreenRect = tileScreenRect.Intersect(currentTileRect);
|
|
|
|
tileScreenRect.MoveBy(origin);
|
|
|
|
|
|
|
|
if (tileScreenRect.IsEmpty())
|
|
|
|
continue;
|
|
|
|
|
|
|
|
tileRegionRect = regionRect->Intersect(currentTileRect);
|
|
|
|
tileRegionRect.MoveBy(-currentTileRect.TopLeft());
|
|
|
|
}
|
|
|
|
gfx::Rect rect(tileScreenRect.x, tileScreenRect.y,
|
|
|
|
tileScreenRect.width, tileScreenRect.height);
|
|
|
|
|
|
|
|
effect->mTextureCoords = Rect(Float(tileRegionRect.x) / texRect.width,
|
|
|
|
Float(tileRegionRect.y) / texRect.height,
|
|
|
|
Float(tileRegionRect.width) / texRect.width,
|
|
|
|
Float(tileRegionRect.height) / texRect.height);
|
|
|
|
GetCompositor()->DrawQuad(rect, aClipRect, aEffectChain, aOpacity, aTransform);
|
|
|
|
if (usingTiles) {
|
2014-04-25 19:34:06 -07:00
|
|
|
DiagnosticFlags diagnostics = DiagnosticFlags::CONTENT | DiagnosticFlags::BIGIMAGE;
|
|
|
|
if (iterOnWhite) {
|
|
|
|
diagnostics |= DiagnosticFlags::COMPONENT_ALPHA;
|
|
|
|
}
|
2013-12-05 10:39:22 -08:00
|
|
|
GetCompositor()->DrawDiagnostics(diagnostics, rect, aClipRect,
|
2014-03-25 09:54:39 -07:00
|
|
|
aTransform, mFlashCounter);
|
2013-12-05 10:39:22 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (iterOnWhite) {
|
|
|
|
iterOnWhite->NextTile();
|
|
|
|
}
|
2014-04-28 04:27:25 -07:00
|
|
|
} while (usingTiles && bigImgIter->NextTile());
|
2013-12-05 10:39:22 -08:00
|
|
|
|
2014-04-28 04:27:25 -07:00
|
|
|
if (bigImgIter) {
|
|
|
|
bigImgIter->EndBigImageIteration();
|
2013-12-05 10:39:22 -08:00
|
|
|
}
|
|
|
|
if (iterOnWhite) {
|
2014-04-28 04:27:25 -07:00
|
|
|
iterOnWhite->EndBigImageIteration();
|
2013-12-05 10:39:22 -08:00
|
|
|
}
|
|
|
|
|
2014-04-25 19:34:06 -07:00
|
|
|
DiagnosticFlags diagnostics = DiagnosticFlags::CONTENT;
|
|
|
|
if (iterOnWhite) {
|
|
|
|
diagnostics |= DiagnosticFlags::COMPONENT_ALPHA;
|
|
|
|
}
|
2014-03-25 09:54:39 -07:00
|
|
|
GetCompositor()->DrawDiagnostics(diagnostics, *aVisibleRegion, aClipRect,
|
|
|
|
aTransform, mFlashCounter);
|
2013-12-05 10:39:22 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
2014-04-01 23:45:02 -07:00
|
|
|
ContentHostTexture::UseTextureHost(TextureHost* aTexture)
|
2013-12-05 10:39:22 -08:00
|
|
|
{
|
2014-04-01 23:45:02 -07:00
|
|
|
ContentHostBase::UseTextureHost(aTexture);
|
2014-02-06 03:28:29 -08:00
|
|
|
mTextureHost = aTexture;
|
|
|
|
mTextureHostOnWhite = nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2014-04-01 23:45:02 -07:00
|
|
|
ContentHostTexture::UseComponentAlphaTextures(TextureHost* aTextureOnBlack,
|
|
|
|
TextureHost* aTextureOnWhite)
|
2014-02-06 03:28:29 -08:00
|
|
|
{
|
2014-04-01 23:45:02 -07:00
|
|
|
ContentHostBase::UseComponentAlphaTextures(aTextureOnBlack, aTextureOnWhite);
|
2014-02-06 03:28:29 -08:00
|
|
|
mTextureHost = aTextureOnBlack;
|
|
|
|
mTextureHostOnWhite = aTextureOnWhite;
|
2013-12-05 10:39:22 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2014-04-01 23:45:02 -07:00
|
|
|
ContentHostTexture::SetCompositor(Compositor* aCompositor)
|
2013-12-05 10:39:22 -08:00
|
|
|
{
|
2014-04-01 23:45:02 -07:00
|
|
|
ContentHostBase::SetCompositor(aCompositor);
|
2013-12-05 10:39:22 -08:00
|
|
|
if (mTextureHost) {
|
|
|
|
mTextureHost->SetCompositor(aCompositor);
|
|
|
|
}
|
|
|
|
if (mTextureHostOnWhite) {
|
|
|
|
mTextureHostOnWhite->SetCompositor(aCompositor);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef MOZ_DUMP_PAINTING
|
|
|
|
void
|
2014-04-01 23:45:02 -07:00
|
|
|
ContentHostTexture::Dump(FILE* aFile,
|
|
|
|
const char* aPrefix,
|
|
|
|
bool aDumpHtml)
|
2013-12-05 10:39:22 -08:00
|
|
|
{
|
|
|
|
if (!aDumpHtml) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (!aFile) {
|
|
|
|
aFile = stderr;
|
|
|
|
}
|
|
|
|
fprintf(aFile, "<ul>");
|
|
|
|
if (mTextureHost) {
|
|
|
|
fprintf(aFile, "%s", aPrefix);
|
|
|
|
fprintf(aFile, "<li> <a href=");
|
|
|
|
DumpTextureHost(aFile, mTextureHost);
|
|
|
|
fprintf(aFile, "> Front buffer </a></li> ");
|
|
|
|
}
|
|
|
|
if (mTextureHostOnWhite) {
|
|
|
|
fprintf(aFile, "%s", aPrefix);
|
|
|
|
fprintf(aFile, "<li> <a href=");
|
|
|
|
DumpTextureHost(aFile, mTextureHostOnWhite);
|
|
|
|
fprintf(aFile, "> Front buffer on white </a> </li> ");
|
|
|
|
}
|
|
|
|
fprintf(aFile, "</ul>");
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2014-04-09 02:15:17 -07:00
|
|
|
static inline void
|
|
|
|
AddWrappedRegion(const nsIntRegion& aInput, nsIntRegion& aOutput,
|
|
|
|
const nsIntSize& aSize, const nsIntPoint& aShift)
|
|
|
|
{
|
|
|
|
nsIntRegion tempRegion;
|
|
|
|
tempRegion.And(nsIntRect(aShift, aSize), aInput);
|
|
|
|
tempRegion.MoveBy(-aShift);
|
|
|
|
aOutput.Or(aOutput, tempRegion);
|
|
|
|
}
|
|
|
|
|
2014-02-20 05:05:32 -08:00
|
|
|
bool
|
2013-12-05 10:39:22 -08:00
|
|
|
ContentHostSingleBuffered::UpdateThebes(const ThebesBufferData& aData,
|
|
|
|
const nsIntRegion& aUpdated,
|
|
|
|
const nsIntRegion& aOldValidRegionBack,
|
|
|
|
nsIntRegion* aUpdatedRegionBack)
|
|
|
|
{
|
|
|
|
aUpdatedRegionBack->SetEmpty();
|
|
|
|
|
|
|
|
if (!mTextureHost) {
|
|
|
|
mInitialised = false;
|
2014-02-20 05:05:32 -08:00
|
|
|
return true; // FIXME should we return false? Returning true for now
|
|
|
|
} // to preserve existing behavior of NOT causing IPC errors.
|
2013-12-05 10:39:22 -08:00
|
|
|
|
|
|
|
// updated is in screen coordinates. Convert it to buffer coordinates.
|
|
|
|
nsIntRegion destRegion(aUpdated);
|
|
|
|
destRegion.MoveBy(-aData.rect().TopLeft());
|
|
|
|
|
2014-04-09 02:15:17 -07:00
|
|
|
if (!aData.rect().Contains(aUpdated.GetBounds()) ||
|
|
|
|
aData.rotation().x > aData.rect().width ||
|
|
|
|
aData.rotation().y > aData.rect().height) {
|
|
|
|
NS_ERROR("Invalid update data");
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
// destRegion is now in logical coordinates relative to the buffer, but we
|
|
|
|
// need to account for rotation. We do that by moving the region to the
|
|
|
|
// rotation offset and then wrapping any pixels that extend off the
|
|
|
|
// bottom/right edges.
|
|
|
|
|
|
|
|
// Shift to the rotation point
|
2013-12-05 10:39:22 -08:00
|
|
|
destRegion.MoveBy(aData.rotation());
|
|
|
|
|
2014-04-09 02:15:17 -07:00
|
|
|
nsIntSize bufferSize = aData.rect().Size();
|
2013-12-05 10:39:22 -08:00
|
|
|
|
2014-04-09 02:15:17 -07:00
|
|
|
// Select only the pixels that are still within the buffer.
|
|
|
|
nsIntRegion finalRegion;
|
|
|
|
finalRegion.And(nsIntRect(nsIntPoint(), bufferSize), destRegion);
|
|
|
|
|
|
|
|
// For each of the overlap areas (right, bottom-right, bottom), select those
|
|
|
|
// pixels and wrap them around to the opposite edge of the buffer rect.
|
|
|
|
AddWrappedRegion(destRegion, finalRegion, bufferSize, nsIntPoint(aData.rect().width, 0));
|
|
|
|
AddWrappedRegion(destRegion, finalRegion, bufferSize, nsIntPoint(aData.rect().width, aData.rect().height));
|
|
|
|
AddWrappedRegion(destRegion, finalRegion, bufferSize, nsIntPoint(0, aData.rect().height));
|
|
|
|
|
|
|
|
MOZ_ASSERT(nsIntRect(0, 0, aData.rect().width, aData.rect().height).Contains(finalRegion.GetBounds()));
|
2013-12-05 10:39:22 -08:00
|
|
|
|
2014-04-09 02:15:17 -07:00
|
|
|
mTextureHost->Updated(&finalRegion);
|
2013-12-05 10:39:22 -08:00
|
|
|
if (mTextureHostOnWhite) {
|
2014-04-09 02:15:17 -07:00
|
|
|
mTextureHostOnWhite->Updated(&finalRegion);
|
2013-12-05 10:39:22 -08:00
|
|
|
}
|
|
|
|
mInitialised = true;
|
|
|
|
|
|
|
|
mBufferRect = aData.rect();
|
|
|
|
mBufferRotation = aData.rotation();
|
2014-02-20 05:05:32 -08:00
|
|
|
|
|
|
|
return true;
|
2013-12-05 10:39:22 -08:00
|
|
|
}
|
|
|
|
|
2014-02-20 05:05:32 -08:00
|
|
|
bool
|
2013-12-05 10:39:22 -08:00
|
|
|
ContentHostDoubleBuffered::UpdateThebes(const ThebesBufferData& aData,
|
|
|
|
const nsIntRegion& aUpdated,
|
|
|
|
const nsIntRegion& aOldValidRegionBack,
|
|
|
|
nsIntRegion* aUpdatedRegionBack)
|
|
|
|
{
|
|
|
|
if (!mTextureHost) {
|
|
|
|
mInitialised = false;
|
|
|
|
|
|
|
|
*aUpdatedRegionBack = aUpdated;
|
2014-02-20 05:05:32 -08:00
|
|
|
return true;
|
2013-12-05 10:39:22 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
// We don't need to calculate an update region because we assume that if we
|
|
|
|
// are using double buffering then we have render-to-texture and thus no
|
|
|
|
// upload to do.
|
|
|
|
mTextureHost->Updated();
|
|
|
|
if (mTextureHostOnWhite) {
|
|
|
|
mTextureHostOnWhite->Updated();
|
|
|
|
}
|
|
|
|
mInitialised = true;
|
|
|
|
|
|
|
|
mBufferRect = aData.rect();
|
|
|
|
mBufferRotation = aData.rotation();
|
|
|
|
|
|
|
|
*aUpdatedRegionBack = aUpdated;
|
|
|
|
|
|
|
|
// Save the current valid region of our front buffer, because if
|
|
|
|
// we're double buffering, it's going to be the valid region for the
|
|
|
|
// next back buffer sent back to the renderer.
|
|
|
|
//
|
|
|
|
// NB: we rely here on the fact that mValidRegion is initialized to
|
|
|
|
// empty, and that the first time Swap() is called we don't have a
|
|
|
|
// valid front buffer that we're going to return to content.
|
|
|
|
mValidRegionForNextBackBuffer = aOldValidRegionBack;
|
2014-02-20 05:05:32 -08:00
|
|
|
|
|
|
|
return true;
|
2013-12-05 10:39:22 -08:00
|
|
|
}
|
|
|
|
|
2014-04-02 00:08:31 -07:00
|
|
|
ContentHostIncremental::ContentHostIncremental(const TextureInfo& aTextureInfo)
|
|
|
|
: ContentHostBase(aTextureInfo)
|
|
|
|
, mDeAllocator(nullptr)
|
|
|
|
, mLocked(false)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
ContentHostIncremental::~ContentHostIncremental()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
ContentHostIncremental::DestroyTextures()
|
|
|
|
{
|
|
|
|
mSource = nullptr;
|
|
|
|
mSourceOnWhite = nullptr;
|
|
|
|
mUpdateList.Clear();
|
|
|
|
}
|
|
|
|
|
2014-04-23 07:46:02 -07:00
|
|
|
bool
|
2014-04-01 23:45:01 -07:00
|
|
|
ContentHostIncremental::CreatedIncrementalTexture(ISurfaceAllocator* aAllocator,
|
|
|
|
const TextureInfo& aTextureInfo,
|
|
|
|
const nsIntRect& aBufferRect)
|
2013-05-15 20:45:43 -07:00
|
|
|
{
|
|
|
|
mUpdateList.AppendElement(new TextureCreationRequest(aTextureInfo,
|
|
|
|
aBufferRect));
|
|
|
|
mDeAllocator = aAllocator;
|
2013-11-14 15:56:42 -08:00
|
|
|
FlushUpdateQueue();
|
2014-04-23 07:46:02 -07:00
|
|
|
return true;
|
2013-05-15 20:45:43 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
ContentHostIncremental::UpdateIncremental(TextureIdentifier aTextureId,
|
|
|
|
SurfaceDescriptor& aSurface,
|
|
|
|
const nsIntRegion& aUpdated,
|
|
|
|
const nsIntRect& aBufferRect,
|
|
|
|
const nsIntPoint& aBufferRotation)
|
|
|
|
{
|
2013-05-21 20:36:38 -07:00
|
|
|
mUpdateList.AppendElement(new TextureUpdateRequest(mDeAllocator,
|
|
|
|
aTextureId,
|
2013-05-15 20:45:43 -07:00
|
|
|
aSurface,
|
|
|
|
aUpdated,
|
|
|
|
aBufferRect,
|
|
|
|
aBufferRotation));
|
2013-11-14 15:56:42 -08:00
|
|
|
FlushUpdateQueue();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
ContentHostIncremental::FlushUpdateQueue()
|
|
|
|
{
|
|
|
|
// If we're not compositing for some reason (the window being minimized
|
|
|
|
// is one example), then we never process these updates and it can consume
|
|
|
|
// huge amounts of memory. Instead we forcibly process the updates (during the
|
|
|
|
// transaction) if the list gets too long.
|
|
|
|
static const uint32_t kMaxUpdateCount = 6;
|
|
|
|
if (mUpdateList.Length() >= kMaxUpdateCount) {
|
|
|
|
ProcessTextureUpdates();
|
|
|
|
}
|
2013-05-15 20:45:43 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
ContentHostIncremental::ProcessTextureUpdates()
|
|
|
|
{
|
|
|
|
for (uint32_t i = 0; i < mUpdateList.Length(); i++) {
|
|
|
|
mUpdateList[i]->Execute(this);
|
|
|
|
}
|
|
|
|
mUpdateList.Clear();
|
|
|
|
}
|
|
|
|
|
2014-04-01 23:45:02 -07:00
|
|
|
NewTextureSource*
|
|
|
|
ContentHostIncremental::GetTextureSource()
|
|
|
|
{
|
|
|
|
MOZ_ASSERT(mLocked);
|
|
|
|
return mSource;
|
|
|
|
}
|
|
|
|
|
|
|
|
NewTextureSource*
|
|
|
|
ContentHostIncremental::GetTextureSourceOnWhite()
|
|
|
|
{
|
|
|
|
MOZ_ASSERT(mLocked);
|
|
|
|
return mSourceOnWhite;
|
|
|
|
}
|
|
|
|
|
2013-05-15 20:45:43 -07:00
|
|
|
void
|
|
|
|
ContentHostIncremental::TextureCreationRequest::Execute(ContentHostIncremental* aHost)
|
|
|
|
{
|
|
|
|
Compositor* compositor = aHost->GetCompositor();
|
2014-04-01 23:45:02 -07:00
|
|
|
MOZ_ASSERT(compositor);
|
|
|
|
|
|
|
|
RefPtr<DataTextureSource> temp =
|
|
|
|
compositor->CreateDataTextureSource(mTextureInfo.mTextureFlags);
|
|
|
|
MOZ_ASSERT(temp->AsSourceOGL() &&
|
|
|
|
temp->AsSourceOGL()->AsTextureImageTextureSource());
|
|
|
|
RefPtr<TextureImageTextureSourceOGL> newSource =
|
|
|
|
temp->AsSourceOGL()->AsTextureImageTextureSource();
|
|
|
|
|
|
|
|
RefPtr<TextureImageTextureSourceOGL> newSourceOnWhite;
|
2014-04-25 19:34:05 -07:00
|
|
|
if (mTextureInfo.mTextureFlags & TextureFlags::COMPONENT_ALPHA) {
|
2014-04-01 23:45:02 -07:00
|
|
|
temp =
|
|
|
|
compositor->CreateDataTextureSource(mTextureInfo.mTextureFlags);
|
|
|
|
MOZ_ASSERT(temp->AsSourceOGL() &&
|
|
|
|
temp->AsSourceOGL()->AsTextureImageTextureSource());
|
|
|
|
newSourceOnWhite = temp->AsSourceOGL()->AsTextureImageTextureSource();
|
2013-05-15 20:45:43 -07:00
|
|
|
}
|
|
|
|
|
2014-04-25 19:34:06 -07:00
|
|
|
if (mTextureInfo.mDeprecatedTextureHostFlags & DeprecatedTextureHostFlags::COPY_PREVIOUS) {
|
2013-05-15 20:45:43 -07:00
|
|
|
nsIntRect bufferRect = aHost->mBufferRect;
|
|
|
|
nsIntPoint bufferRotation = aHost->mBufferRotation;
|
|
|
|
nsIntRect overlap;
|
|
|
|
|
|
|
|
// The buffer looks like:
|
|
|
|
// ______
|
|
|
|
// |1 |2 | Where the center point is offset by mBufferRotation from the top-left corner.
|
|
|
|
// |___|__|
|
|
|
|
// |3 |4 |
|
|
|
|
// |___|__|
|
|
|
|
//
|
|
|
|
// This is drawn to the screen as:
|
|
|
|
// ______
|
|
|
|
// |4 |3 | Where the center point is { width - mBufferRotation.x, height - mBufferRotation.y } from
|
|
|
|
// |___|__| from the top left corner - rotationPoint.
|
|
|
|
// |2 |1 |
|
|
|
|
// |___|__|
|
|
|
|
//
|
|
|
|
|
|
|
|
// The basic idea below is to take all quadrant rectangles from the src and transform them into rectangles
|
|
|
|
// in the destination. Unfortunately, it seems it is overly complex and could perhaps be simplified.
|
|
|
|
|
|
|
|
nsIntRect srcBufferSpaceBottomRight(bufferRotation.x, bufferRotation.y, bufferRect.width - bufferRotation.x, bufferRect.height - bufferRotation.y);
|
|
|
|
nsIntRect srcBufferSpaceTopRight(bufferRotation.x, 0, bufferRect.width - bufferRotation.x, bufferRotation.y);
|
|
|
|
nsIntRect srcBufferSpaceTopLeft(0, 0, bufferRotation.x, bufferRotation.y);
|
|
|
|
nsIntRect srcBufferSpaceBottomLeft(0, bufferRotation.y, bufferRotation.x, bufferRect.height - bufferRotation.y);
|
|
|
|
|
|
|
|
overlap.IntersectRect(bufferRect, mBufferRect);
|
|
|
|
|
|
|
|
nsIntRect srcRect(overlap), dstRect(overlap);
|
|
|
|
srcRect.MoveBy(- bufferRect.TopLeft() + bufferRotation);
|
|
|
|
|
|
|
|
nsIntRect srcRectDrawTopRight(srcRect);
|
|
|
|
nsIntRect srcRectDrawTopLeft(srcRect);
|
|
|
|
nsIntRect srcRectDrawBottomLeft(srcRect);
|
|
|
|
// transform into the different quadrants
|
|
|
|
srcRectDrawTopRight .MoveBy(-nsIntPoint(0, bufferRect.height));
|
|
|
|
srcRectDrawTopLeft .MoveBy(-nsIntPoint(bufferRect.width, bufferRect.height));
|
|
|
|
srcRectDrawBottomLeft.MoveBy(-nsIntPoint(bufferRect.width, 0));
|
|
|
|
|
|
|
|
// Intersect with the quadrant
|
|
|
|
srcRect = srcRect .Intersect(srcBufferSpaceBottomRight);
|
|
|
|
srcRectDrawTopRight = srcRectDrawTopRight .Intersect(srcBufferSpaceTopRight);
|
|
|
|
srcRectDrawTopLeft = srcRectDrawTopLeft .Intersect(srcBufferSpaceTopLeft);
|
|
|
|
srcRectDrawBottomLeft = srcRectDrawBottomLeft.Intersect(srcBufferSpaceBottomLeft);
|
|
|
|
|
|
|
|
dstRect = srcRect;
|
|
|
|
nsIntRect dstRectDrawTopRight(srcRectDrawTopRight);
|
|
|
|
nsIntRect dstRectDrawTopLeft(srcRectDrawTopLeft);
|
|
|
|
nsIntRect dstRectDrawBottomLeft(srcRectDrawBottomLeft);
|
|
|
|
|
|
|
|
// transform back to src buffer space
|
|
|
|
dstRect .MoveBy(-bufferRotation);
|
|
|
|
dstRectDrawTopRight .MoveBy(-bufferRotation + nsIntPoint(0, bufferRect.height));
|
|
|
|
dstRectDrawTopLeft .MoveBy(-bufferRotation + nsIntPoint(bufferRect.width, bufferRect.height));
|
|
|
|
dstRectDrawBottomLeft.MoveBy(-bufferRotation + nsIntPoint(bufferRect.width, 0));
|
|
|
|
|
|
|
|
// transform back to draw coordinates
|
|
|
|
dstRect .MoveBy(bufferRect.TopLeft());
|
|
|
|
dstRectDrawTopRight .MoveBy(bufferRect.TopLeft());
|
|
|
|
dstRectDrawTopLeft .MoveBy(bufferRect.TopLeft());
|
|
|
|
dstRectDrawBottomLeft.MoveBy(bufferRect.TopLeft());
|
|
|
|
|
|
|
|
// transform to destBuffer space
|
|
|
|
dstRect .MoveBy(-mBufferRect.TopLeft());
|
|
|
|
dstRectDrawTopRight .MoveBy(-mBufferRect.TopLeft());
|
|
|
|
dstRectDrawTopLeft .MoveBy(-mBufferRect.TopLeft());
|
|
|
|
dstRectDrawBottomLeft.MoveBy(-mBufferRect.TopLeft());
|
|
|
|
|
2014-04-01 23:45:02 -07:00
|
|
|
newSource->EnsureBuffer(mBufferRect.Size(),
|
|
|
|
ContentForFormat(aHost->mSource->GetFormat()));
|
2013-05-15 20:45:43 -07:00
|
|
|
|
2014-04-01 23:45:02 -07:00
|
|
|
aHost->mSource->CopyTo(srcRect, newSource, dstRect);
|
2013-05-15 20:45:43 -07:00
|
|
|
if (bufferRotation != nsIntPoint(0, 0)) {
|
|
|
|
// Draw the remaining quadrants. We call BlitTextureImage 3 extra
|
|
|
|
// times instead of doing a single draw call because supporting that
|
|
|
|
// with a tiled source is quite tricky.
|
|
|
|
|
|
|
|
if (!srcRectDrawTopRight.IsEmpty())
|
2014-04-01 23:45:02 -07:00
|
|
|
aHost->mSource->CopyTo(srcRectDrawTopRight,
|
|
|
|
newSource, dstRectDrawTopRight);
|
2013-05-15 20:45:43 -07:00
|
|
|
if (!srcRectDrawTopLeft.IsEmpty())
|
2014-04-01 23:45:02 -07:00
|
|
|
aHost->mSource->CopyTo(srcRectDrawTopLeft,
|
|
|
|
newSource, dstRectDrawTopLeft);
|
2013-05-15 20:45:43 -07:00
|
|
|
if (!srcRectDrawBottomLeft.IsEmpty())
|
2014-04-01 23:45:02 -07:00
|
|
|
aHost->mSource->CopyTo(srcRectDrawBottomLeft,
|
|
|
|
newSource, dstRectDrawBottomLeft);
|
2013-05-15 20:45:43 -07:00
|
|
|
}
|
|
|
|
|
2014-04-01 23:45:02 -07:00
|
|
|
if (newSourceOnWhite) {
|
|
|
|
newSourceOnWhite->EnsureBuffer(mBufferRect.Size(),
|
|
|
|
ContentForFormat(aHost->mSourceOnWhite->GetFormat()));
|
|
|
|
aHost->mSourceOnWhite->CopyTo(srcRect, newSourceOnWhite, dstRect);
|
2013-05-15 20:45:43 -07:00
|
|
|
if (bufferRotation != nsIntPoint(0, 0)) {
|
|
|
|
// draw the remaining quadrants
|
|
|
|
if (!srcRectDrawTopRight.IsEmpty())
|
2014-04-01 23:45:02 -07:00
|
|
|
aHost->mSourceOnWhite->CopyTo(srcRectDrawTopRight,
|
|
|
|
newSourceOnWhite, dstRectDrawTopRight);
|
2013-05-15 20:45:43 -07:00
|
|
|
if (!srcRectDrawTopLeft.IsEmpty())
|
2014-04-01 23:45:02 -07:00
|
|
|
aHost->mSourceOnWhite->CopyTo(srcRectDrawTopLeft,
|
|
|
|
newSourceOnWhite, dstRectDrawTopLeft);
|
2013-05-15 20:45:43 -07:00
|
|
|
if (!srcRectDrawBottomLeft.IsEmpty())
|
2014-04-01 23:45:02 -07:00
|
|
|
aHost->mSourceOnWhite->CopyTo(srcRectDrawBottomLeft,
|
|
|
|
newSourceOnWhite, dstRectDrawBottomLeft);
|
2013-05-15 20:45:43 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-04-01 23:45:02 -07:00
|
|
|
aHost->mSource = newSource;
|
|
|
|
aHost->mSourceOnWhite = newSourceOnWhite;
|
2013-05-15 20:45:43 -07:00
|
|
|
|
|
|
|
aHost->mBufferRect = mBufferRect;
|
|
|
|
aHost->mBufferRotation = nsIntPoint();
|
|
|
|
}
|
|
|
|
|
|
|
|
nsIntRect
|
|
|
|
ContentHostIncremental::TextureUpdateRequest::GetQuadrantRectangle(XSide aXSide,
|
|
|
|
YSide aYSide) const
|
|
|
|
{
|
|
|
|
// quadrantTranslation is the amount we translate the top-left
|
|
|
|
// of the quadrant by to get coordinates relative to the layer
|
|
|
|
nsIntPoint quadrantTranslation = -mBufferRotation;
|
|
|
|
quadrantTranslation.x += aXSide == LEFT ? mBufferRect.width : 0;
|
|
|
|
quadrantTranslation.y += aYSide == TOP ? mBufferRect.height : 0;
|
|
|
|
return mBufferRect + quadrantTranslation;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
ContentHostIncremental::TextureUpdateRequest::Execute(ContentHostIncremental* aHost)
|
|
|
|
{
|
|
|
|
nsIntRect drawBounds = mUpdated.GetBounds();
|
|
|
|
|
|
|
|
aHost->mBufferRect = mBufferRect;
|
|
|
|
aHost->mBufferRotation = mBufferRotation;
|
|
|
|
|
|
|
|
// Figure out which quadrant to draw in
|
|
|
|
int32_t xBoundary = mBufferRect.XMost() - mBufferRotation.x;
|
|
|
|
int32_t yBoundary = mBufferRect.YMost() - mBufferRotation.y;
|
|
|
|
XSide sideX = drawBounds.XMost() <= xBoundary ? RIGHT : LEFT;
|
|
|
|
YSide sideY = drawBounds.YMost() <= yBoundary ? BOTTOM : TOP;
|
|
|
|
nsIntRect quadrantRect = GetQuadrantRectangle(sideX, sideY);
|
|
|
|
NS_ASSERTION(quadrantRect.Contains(drawBounds), "Messed up quadrants");
|
|
|
|
|
|
|
|
mUpdated.MoveBy(-nsIntPoint(quadrantRect.x, quadrantRect.y));
|
|
|
|
|
2014-04-01 23:45:02 -07:00
|
|
|
IntPoint offset = ToIntPoint(-mUpdated.GetBounds().TopLeft());
|
|
|
|
|
2014-04-06 18:32:48 -07:00
|
|
|
RefPtr<DataSourceSurface> surf = GetSurfaceForDescriptor(mDescriptor);
|
2013-05-15 20:45:43 -07:00
|
|
|
|
2014-04-25 19:34:06 -07:00
|
|
|
if (mTextureId == TextureIdentifier::Front) {
|
2014-04-06 18:32:48 -07:00
|
|
|
aHost->mSource->Update(surf, &mUpdated, &offset);
|
2013-05-15 20:45:43 -07:00
|
|
|
} else {
|
2014-04-06 18:32:48 -07:00
|
|
|
aHost->mSourceOnWhite->Update(surf, &mUpdated, &offset);
|
2013-05-15 20:45:43 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-05-02 14:29:29 -07:00
|
|
|
void
|
|
|
|
ContentHostIncremental::PrintInfo(nsACString& aTo, const char* aPrefix)
|
|
|
|
{
|
|
|
|
aTo += aPrefix;
|
|
|
|
aTo += nsPrintfCString("ContentHostIncremental (0x%p)", this);
|
|
|
|
|
|
|
|
if (PaintWillResample()) {
|
|
|
|
aTo += " [paint-will-resample]";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-11-27 13:16:34 -08:00
|
|
|
void
|
2014-04-01 23:45:02 -07:00
|
|
|
ContentHostTexture::PrintInfo(nsACString& aTo, const char* aPrefix)
|
2013-12-05 10:39:22 -08:00
|
|
|
{
|
|
|
|
aTo += aPrefix;
|
|
|
|
aTo += nsPrintfCString("ContentHost (0x%p)", this);
|
|
|
|
|
|
|
|
AppendToString(aTo, mBufferRect, " [buffer-rect=", "]");
|
|
|
|
AppendToString(aTo, mBufferRotation, " [buffer-rotation=", "]");
|
|
|
|
if (PaintWillResample()) {
|
|
|
|
aTo += " [paint-will-resample]";
|
|
|
|
}
|
|
|
|
|
|
|
|
if (mTextureHost) {
|
2014-05-02 14:29:29 -07:00
|
|
|
nsAutoCString pfx(aPrefix);
|
|
|
|
pfx += " ";
|
|
|
|
|
2013-12-05 10:39:22 -08:00
|
|
|
aTo += "\n";
|
|
|
|
mTextureHost->PrintInfo(aTo, pfx.get());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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
|
|
|
|
2013-11-27 13:16:34 -08:00
|
|
|
LayerRenderState
|
2014-04-01 23:45:02 -07:00
|
|
|
ContentHostTexture::GetRenderState()
|
2013-12-05 10:39:22 -08:00
|
|
|
{
|
|
|
|
if (!mTextureHost) {
|
|
|
|
return LayerRenderState();
|
|
|
|
}
|
|
|
|
|
|
|
|
LayerRenderState result = mTextureHost->GetRenderState();
|
|
|
|
|
|
|
|
if (mBufferRotation != nsIntPoint()) {
|
2014-04-25 19:34:05 -07:00
|
|
|
result.mFlags |= LayerRenderStateFlags::BUFFER_ROTATION;
|
2013-12-05 10:39:22 -08:00
|
|
|
}
|
|
|
|
result.SetOffset(GetOriginOffset());
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2013-07-30 02:59:51 -07:00
|
|
|
#ifdef MOZ_DUMP_PAINTING
|
2013-11-27 13:16:34 -08:00
|
|
|
TemporaryRef<gfx::DataSourceSurface>
|
2014-04-01 23:45:02 -07:00
|
|
|
ContentHostTexture::GetAsSurface()
|
2013-12-05 10:39:22 -08:00
|
|
|
{
|
|
|
|
if (!mTextureHost) {
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
return mTextureHost->GetAsSurface();
|
|
|
|
}
|
|
|
|
|
2013-07-30 02:59:51 -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
|
|
|
} // namespace
|
|
|
|
} // namespace
|