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 13:20:52 +04: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-12 03:17:23 +04:00
|
|
|
#include "LayersLogging.h" // for AppendToString
|
|
|
|
#include "gfx2DGlue.h" // for ContentForFormat
|
2013-12-20 20:46:28 +04:00
|
|
|
#include "mozilla/gfx/Point.h" // for IntSize
|
2013-08-12 03:17:23 +04: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 19:41:00 +04:00
|
|
|
#include "mozilla/layers/LayersMessages.h" // for ThebesBufferData
|
2013-08-12 03:17:23 +04:00
|
|
|
#include "nsAString.h"
|
|
|
|
#include "nsPrintfCString.h" // for nsPrintfCString
|
|
|
|
#include "nsString.h" // for nsAutoCString
|
|
|
|
|
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 13:20:52 +04:00
|
|
|
namespace mozilla {
|
2013-08-12 03:17:23 +04: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 13:20:52 +04:00
|
|
|
using namespace gfx;
|
2013-08-12 03:17:23 +04: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 13:20:52 +04:00
|
|
|
namespace layers {
|
|
|
|
|
2013-11-28 01:16:35 +04:00
|
|
|
ContentHostBase::ContentHostBase(const TextureInfo& aTextureInfo)
|
2013-11-28 01:16:34 +04:00
|
|
|
: ContentHost(aTextureInfo)
|
|
|
|
, mPaintWillResample(false)
|
|
|
|
, mInitialised(false)
|
|
|
|
{}
|
|
|
|
|
2013-11-28 01:16:35 +04:00
|
|
|
ContentHostBase::~ContentHostBase()
|
2013-12-05 22:39:22 +04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
TextureHost*
|
|
|
|
ContentHostBase::GetAsTextureHost()
|
|
|
|
{
|
|
|
|
return mTextureHost;
|
|
|
|
}
|
|
|
|
|
|
|
|
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");
|
|
|
|
|
2013-12-19 20:20:51 +04:00
|
|
|
if (!mTextureHost) {
|
|
|
|
NS_WARNING("Missing TextureHost");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2013-12-05 22:39:22 +04:00
|
|
|
AutoLockTextureHost lock(mTextureHost);
|
|
|
|
AutoLockTextureHost lockOnWhite(mTextureHostOnWhite);
|
|
|
|
|
2013-12-19 20:20:51 +04:00
|
|
|
if (lock.Failed() || lockOnWhite.Failed()) {
|
2013-12-05 22:39:22 +04:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
RefPtr<NewTextureSource> source = mTextureHost->GetTextureSources();
|
|
|
|
RefPtr<NewTextureSource> sourceOnWhite = mTextureHostOnWhite
|
|
|
|
? mTextureHostOnWhite->GetTextureSources()
|
|
|
|
: nullptr;
|
|
|
|
if (!source) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
RefPtr<TexturedEffect> effect =
|
|
|
|
CreateTexturedEffect(source, sourceOnWhite, aFilter);
|
|
|
|
|
2014-01-07 20:20:11 +04:00
|
|
|
if (!effect) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2013-12-05 22:39:22 +04: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);
|
|
|
|
}
|
|
|
|
|
|
|
|
TileIterator* tileIter = source->AsTileIterator();
|
|
|
|
TileIterator* iterOnWhite = nullptr;
|
|
|
|
if (tileIter) {
|
|
|
|
tileIter->BeginTileIteration();
|
|
|
|
}
|
|
|
|
|
2014-01-23 18:14:58 +04:00
|
|
|
if (sourceOnWhite) {
|
2013-12-05 22:39:22 +04:00
|
|
|
iterOnWhite = sourceOnWhite->AsTileIterator();
|
|
|
|
MOZ_ASSERT(!tileIter || tileIter->GetTileCount() == iterOnWhite->GetTileCount(),
|
|
|
|
"Tile count mismatch on component alpha texture");
|
|
|
|
if (iterOnWhite) {
|
|
|
|
iterOnWhite->BeginTileIteration();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool usingTiles = (tileIter && tileIter->GetTileCount() > 1);
|
|
|
|
do {
|
|
|
|
if (iterOnWhite) {
|
|
|
|
MOZ_ASSERT(iterOnWhite->GetTileRect() == tileIter->GetTileRect(),
|
|
|
|
"component alpha textures should be the same size.");
|
|
|
|
}
|
|
|
|
|
|
|
|
nsIntRect texRect = tileIter ? tileIter->GetTileRect()
|
|
|
|
: 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) {
|
|
|
|
DiagnosticTypes diagnostics = DIAGNOSTIC_CONTENT | DIAGNOSTIC_BIGIMAGE;
|
|
|
|
diagnostics |= iterOnWhite ? DIAGNOSTIC_COMPONENT_ALPHA : 0;
|
|
|
|
GetCompositor()->DrawDiagnostics(diagnostics, rect, aClipRect,
|
|
|
|
aTransform);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (iterOnWhite) {
|
|
|
|
iterOnWhite->NextTile();
|
|
|
|
}
|
|
|
|
} while (usingTiles && tileIter->NextTile());
|
|
|
|
|
|
|
|
if (tileIter) {
|
|
|
|
tileIter->EndTileIteration();
|
|
|
|
}
|
|
|
|
if (iterOnWhite) {
|
|
|
|
iterOnWhite->EndTileIteration();
|
|
|
|
}
|
|
|
|
|
|
|
|
DiagnosticTypes diagnostics = DIAGNOSTIC_CONTENT;
|
|
|
|
diagnostics |= iterOnWhite ? DIAGNOSTIC_COMPONENT_ALPHA : 0;
|
|
|
|
GetCompositor()->DrawDiagnostics(diagnostics, *aVisibleRegion, aClipRect, aTransform);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
ContentHostBase::UseTextureHost(TextureHost* aTexture)
|
|
|
|
{
|
2014-02-13 18:46:59 +04:00
|
|
|
CompositableHost::UseTextureHost(aTexture);
|
2014-02-06 15:28:29 +04:00
|
|
|
mTextureHost = aTexture;
|
|
|
|
mTextureHostOnWhite = nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
ContentHostBase::UseComponentAlphaTextures(TextureHost* aTextureOnBlack,
|
|
|
|
TextureHost* aTextureOnWhite)
|
|
|
|
{
|
|
|
|
CompositableHost::UseComponentAlphaTextures(aTextureOnBlack, aTextureOnWhite);
|
|
|
|
mTextureHost = aTextureOnBlack;
|
|
|
|
mTextureHostOnWhite = aTextureOnWhite;
|
2013-12-05 22:39:22 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
ContentHostBase::SetCompositor(Compositor* aCompositor)
|
|
|
|
{
|
|
|
|
CompositableHost::SetCompositor(aCompositor);
|
|
|
|
if (mTextureHost) {
|
|
|
|
mTextureHost->SetCompositor(aCompositor);
|
|
|
|
}
|
|
|
|
if (mTextureHostOnWhite) {
|
|
|
|
mTextureHostOnWhite->SetCompositor(aCompositor);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef MOZ_DUMP_PAINTING
|
|
|
|
void
|
|
|
|
ContentHostBase::Dump(FILE* aFile,
|
|
|
|
const char* aPrefix,
|
|
|
|
bool aDumpHtml)
|
|
|
|
{
|
|
|
|
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
|
|
|
|
|
|
|
|
DeprecatedContentHostBase::DeprecatedContentHostBase(const TextureInfo& aTextureInfo)
|
|
|
|
: ContentHost(aTextureInfo)
|
|
|
|
, mPaintWillResample(false)
|
|
|
|
, mInitialised(false)
|
|
|
|
{}
|
|
|
|
|
|
|
|
DeprecatedContentHostBase::~DeprecatedContentHostBase()
|
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 13:20:52 +04:00
|
|
|
{}
|
|
|
|
|
2013-07-09 01:30:44 +04:00
|
|
|
DeprecatedTextureHost*
|
2013-12-05 22:39:22 +04:00
|
|
|
DeprecatedContentHostBase::GetDeprecatedTextureHost()
|
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 13:20:52 +04:00
|
|
|
{
|
2013-07-09 01:30:44 +04:00
|
|
|
return mDeprecatedTextureHost;
|
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 13:20:52 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2013-12-05 22:39:22 +04:00
|
|
|
DeprecatedContentHostBase::DestroyFrontHost()
|
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 13:20:52 +04:00
|
|
|
{
|
2013-07-09 01:30:44 +04:00
|
|
|
MOZ_ASSERT(!mDeprecatedTextureHost || mDeprecatedTextureHost->GetDeAllocator(),
|
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 13:20:52 +04:00
|
|
|
"We won't be able to destroy our SurfaceDescriptor");
|
2013-07-09 01:30:44 +04:00
|
|
|
MOZ_ASSERT(!mDeprecatedTextureHostOnWhite || mDeprecatedTextureHostOnWhite->GetDeAllocator(),
|
2013-04-22 06:40:52 +04:00
|
|
|
"We won't be able to destroy our SurfaceDescriptor");
|
2013-07-09 01:30:44 +04:00
|
|
|
mDeprecatedTextureHost = nullptr;
|
|
|
|
mDeprecatedTextureHostOnWhite = 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 13:20:52 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2013-12-05 22:39:22 +04:00
|
|
|
DeprecatedContentHostBase::Composite(EffectChain& aEffectChain,
|
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 13:20:52 +04:00
|
|
|
float aOpacity,
|
|
|
|
const gfx::Matrix4x4& aTransform,
|
|
|
|
const Filter& aFilter,
|
|
|
|
const Rect& aClipRect,
|
|
|
|
const nsIntRegion* aVisibleRegion,
|
|
|
|
TiledLayerProperties* aLayerProperties)
|
|
|
|
{
|
|
|
|
NS_ASSERTION(aVisibleRegion, "Requires a visible region");
|
|
|
|
|
2013-07-09 01:30:44 +04:00
|
|
|
AutoLockDeprecatedTextureHost lock(mDeprecatedTextureHost);
|
|
|
|
AutoLockDeprecatedTextureHost lockOnWhite(mDeprecatedTextureHostOnWhite);
|
2013-04-22 06:40:52 +04:00
|
|
|
|
2013-07-09 01:30:44 +04:00
|
|
|
if (!mDeprecatedTextureHost ||
|
2013-04-22 06:40:52 +04:00
|
|
|
!lock.IsValid() ||
|
|
|
|
!lockOnWhite.IsValid()) {
|
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 13:20:52 +04:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
RefPtr<TexturedEffect> effect =
|
2013-07-09 01:30:44 +04:00
|
|
|
CreateTexturedEffect(mDeprecatedTextureHost, mDeprecatedTextureHostOnWhite, aFilter);
|
2013-11-22 02:07:56 +04:00
|
|
|
if (!effect) {
|
|
|
|
return;
|
|
|
|
}
|
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 13:20:52 +04: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();
|
|
|
|
region.MoveBy(-origin); // translate into TexImage space, buffer origin might not be at texture (0,0)
|
|
|
|
|
|
|
|
// Figure out the intersecting draw region
|
2013-07-09 01:30:44 +04:00
|
|
|
TextureSource* source = mDeprecatedTextureHost;
|
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 13:20:52 +04:00
|
|
|
MOZ_ASSERT(source);
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
|
|
|
TileIterator* tileIter = source->AsTileIterator();
|
|
|
|
TileIterator* iterOnWhite = nullptr;
|
|
|
|
if (tileIter) {
|
|
|
|
tileIter->BeginTileIteration();
|
|
|
|
}
|
|
|
|
|
2013-07-09 01:30:44 +04:00
|
|
|
if (mDeprecatedTextureHostOnWhite) {
|
|
|
|
iterOnWhite = mDeprecatedTextureHostOnWhite->AsTileIterator();
|
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 13:20:52 +04:00
|
|
|
MOZ_ASSERT(!tileIter || tileIter->GetTileCount() == iterOnWhite->GetTileCount(),
|
|
|
|
"Tile count mismatch on component alpha texture");
|
|
|
|
if (iterOnWhite) {
|
|
|
|
iterOnWhite->BeginTileIteration();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool usingTiles = (tileIter && tileIter->GetTileCount() > 1);
|
|
|
|
do {
|
|
|
|
if (iterOnWhite) {
|
|
|
|
MOZ_ASSERT(iterOnWhite->GetTileRect() == tileIter->GetTileRect(),
|
|
|
|
"component alpha textures should be the same size.");
|
|
|
|
}
|
|
|
|
|
|
|
|
nsIntRect texRect = tileIter ? tileIter->GetTileRect()
|
|
|
|
: 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);
|
2013-11-07 13:53:08 +04:00
|
|
|
GetCompositor()->DrawQuad(rect, aClipRect, aEffectChain, aOpacity, aTransform);
|
2013-10-24 18:35:29 +04:00
|
|
|
if (usingTiles) {
|
|
|
|
DiagnosticTypes diagnostics = DIAGNOSTIC_CONTENT | DIAGNOSTIC_BIGIMAGE;
|
|
|
|
diagnostics |= iterOnWhite ? DIAGNOSTIC_COMPONENT_ALPHA : 0;
|
|
|
|
GetCompositor()->DrawDiagnostics(diagnostics, rect, aClipRect,
|
2013-11-07 13:53:08 +04:00
|
|
|
aTransform);
|
2013-10-24 18:35:29 +04: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 13:20:52 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (iterOnWhite) {
|
|
|
|
iterOnWhite->NextTile();
|
|
|
|
}
|
|
|
|
} while (usingTiles && tileIter->NextTile());
|
|
|
|
|
|
|
|
if (tileIter) {
|
|
|
|
tileIter->EndTileIteration();
|
|
|
|
}
|
|
|
|
if (iterOnWhite) {
|
|
|
|
iterOnWhite->EndTileIteration();
|
|
|
|
}
|
2013-10-24 18:35:29 +04:00
|
|
|
|
|
|
|
DiagnosticTypes diagnostics = DIAGNOSTIC_CONTENT;
|
|
|
|
diagnostics |= iterOnWhite ? DIAGNOSTIC_COMPONENT_ALPHA : 0;
|
2013-11-07 13:53:08 +04:00
|
|
|
GetCompositor()->DrawDiagnostics(diagnostics, *aVisibleRegion, aClipRect, aTransform);
|
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 13:20:52 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2013-12-05 22:39:22 +04:00
|
|
|
DeprecatedContentHostBase::SetCompositor(Compositor* aCompositor)
|
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 13:20:52 +04:00
|
|
|
{
|
|
|
|
CompositableHost::SetCompositor(aCompositor);
|
2013-07-09 01:30:44 +04:00
|
|
|
if (mDeprecatedTextureHost) {
|
|
|
|
mDeprecatedTextureHost->SetCompositor(aCompositor);
|
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 13:20:52 +04:00
|
|
|
}
|
2013-07-09 01:30:44 +04:00
|
|
|
if (mDeprecatedTextureHostOnWhite) {
|
|
|
|
mDeprecatedTextureHostOnWhite->SetCompositor(aCompositor);
|
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 13:20:52 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-08-08 16:53:12 +04:00
|
|
|
#ifdef MOZ_DUMP_PAINTING
|
|
|
|
|
2013-05-26 06:44:24 +04:00
|
|
|
void
|
2013-12-05 22:39:22 +04:00
|
|
|
DeprecatedContentHostBase::Dump(FILE* aFile,
|
2013-05-26 06:44:24 +04:00
|
|
|
const char* aPrefix,
|
|
|
|
bool aDumpHtml)
|
|
|
|
{
|
2013-09-10 04:08:42 +04:00
|
|
|
if (!aDumpHtml) {
|
|
|
|
return;
|
|
|
|
}
|
2013-05-26 06:44:24 +04:00
|
|
|
if (!aFile) {
|
|
|
|
aFile = stderr;
|
|
|
|
}
|
2013-11-24 02:44:18 +04:00
|
|
|
fprintf_stderr(aFile, "<ul>");
|
2013-07-09 01:30:44 +04:00
|
|
|
if (mDeprecatedTextureHost) {
|
2013-11-24 02:44:18 +04:00
|
|
|
fprintf_stderr(aFile, "%s", aPrefix);
|
|
|
|
fprintf_stderr(aFile, "<li> <a href=");
|
2013-07-09 01:30:44 +04:00
|
|
|
DumpDeprecatedTextureHost(aFile, mDeprecatedTextureHost);
|
2013-11-24 02:44:18 +04:00
|
|
|
fprintf_stderr(aFile, "> Front buffer </a></li> ");
|
2013-05-26 06:44:24 +04:00
|
|
|
}
|
2013-07-09 01:30:44 +04:00
|
|
|
if (mDeprecatedTextureHostOnWhite) {
|
2013-11-24 02:44:18 +04:00
|
|
|
fprintf_stderr(aFile, "%s", aPrefix);
|
|
|
|
fprintf_stderr(aFile, "<li> <a href=");
|
2013-07-09 01:30:44 +04:00
|
|
|
DumpDeprecatedTextureHost(aFile, mDeprecatedTextureHostOnWhite);
|
2013-11-24 02:44:18 +04:00
|
|
|
fprintf_stderr(aFile, "> Front buffer on white </a> </li> ");
|
2013-05-26 06:44:24 +04:00
|
|
|
}
|
2013-11-24 02:44:18 +04:00
|
|
|
fprintf_stderr(aFile, "</ul>");
|
2013-05-26 06:44:24 +04:00
|
|
|
}
|
|
|
|
|
2013-08-08 16:53:12 +04:00
|
|
|
#endif
|
|
|
|
|
2013-12-05 22:39:22 +04:00
|
|
|
void
|
|
|
|
ContentHostSingleBuffered::UpdateThebes(const ThebesBufferData& aData,
|
|
|
|
const nsIntRegion& aUpdated,
|
|
|
|
const nsIntRegion& aOldValidRegionBack,
|
|
|
|
nsIntRegion* aUpdatedRegionBack)
|
|
|
|
{
|
|
|
|
aUpdatedRegionBack->SetEmpty();
|
|
|
|
|
|
|
|
if (!mTextureHost) {
|
|
|
|
mInitialised = false;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// updated is in screen coordinates. Convert it to buffer coordinates.
|
|
|
|
nsIntRegion destRegion(aUpdated);
|
|
|
|
destRegion.MoveBy(-aData.rect().TopLeft());
|
|
|
|
|
|
|
|
// Correct for rotation
|
|
|
|
destRegion.MoveBy(aData.rotation());
|
|
|
|
|
2013-12-31 13:06:12 +04:00
|
|
|
IntSize size = aData.rect().Size().ToIntSize();
|
2013-12-05 22:39:22 +04:00
|
|
|
nsIntRect destBounds = destRegion.GetBounds();
|
|
|
|
destRegion.MoveBy((destBounds.x >= size.width) ? -size.width : 0,
|
|
|
|
(destBounds.y >= size.height) ? -size.height : 0);
|
|
|
|
|
|
|
|
// There's code to make sure that updated regions don't cross rotation
|
|
|
|
// boundaries, so assert here that this is the case
|
|
|
|
MOZ_ASSERT((destBounds.x % size.width) + destBounds.width <= size.width,
|
|
|
|
"updated region lies across rotation boundaries!");
|
|
|
|
MOZ_ASSERT((destBounds.y % size.height) + destBounds.height <= size.height,
|
|
|
|
"updated region lies across rotation boundaries!");
|
|
|
|
|
|
|
|
mTextureHost->Updated(&destRegion);
|
|
|
|
if (mTextureHostOnWhite) {
|
|
|
|
mTextureHostOnWhite->Updated(&destRegion);
|
|
|
|
}
|
|
|
|
mInitialised = true;
|
|
|
|
|
|
|
|
mBufferRect = aData.rect();
|
|
|
|
mBufferRotation = aData.rotation();
|
|
|
|
}
|
|
|
|
|
|
|
|
DeprecatedContentHostSingleBuffered::~DeprecatedContentHostSingleBuffered()
|
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 13:20:52 +04:00
|
|
|
{
|
|
|
|
DestroyTextures();
|
|
|
|
DestroyFrontHost();
|
|
|
|
}
|
|
|
|
|
2013-04-24 18:32:43 +04:00
|
|
|
void
|
2013-12-05 22:39:22 +04:00
|
|
|
DeprecatedContentHostSingleBuffered::EnsureDeprecatedTextureHost(TextureIdentifier aTextureId,
|
2013-04-12 11:28:55 +04:00
|
|
|
const SurfaceDescriptor& aSurface,
|
|
|
|
ISurfaceAllocator* aAllocator,
|
|
|
|
const TextureInfo& aTextureInfo)
|
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 13:20:52 +04:00
|
|
|
{
|
2013-04-22 06:40:52 +04:00
|
|
|
MOZ_ASSERT(aTextureId == TextureFront ||
|
|
|
|
aTextureId == TextureOnWhiteFront);
|
2013-07-09 01:30:44 +04:00
|
|
|
RefPtr<DeprecatedTextureHost> *newHost =
|
2013-04-22 06:40:52 +04:00
|
|
|
(aTextureId == TextureFront) ? &mNewFrontHost : &mNewFrontHostOnWhite;
|
|
|
|
|
2013-07-09 01:30:44 +04:00
|
|
|
*newHost = DeprecatedTextureHost::CreateDeprecatedTextureHost(aSurface.type(),
|
|
|
|
aTextureInfo.mDeprecatedTextureHostFlags,
|
2013-09-13 06:39:26 +04:00
|
|
|
aTextureInfo.mTextureFlags,
|
|
|
|
this);
|
2013-04-12 11:28:55 +04:00
|
|
|
|
2013-04-22 06:40:52 +04:00
|
|
|
(*newHost)->SetBuffer(new SurfaceDescriptor(aSurface), aAllocator);
|
2013-04-12 11:28:55 +04:00
|
|
|
Compositor* compositor = GetCompositor();
|
|
|
|
if (compositor) {
|
2013-04-22 06:40:52 +04:00
|
|
|
(*newHost)->SetCompositor(compositor);
|
2013-04-12 11:28:55 +04: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 13:20:52 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2013-12-05 22:39:22 +04:00
|
|
|
DeprecatedContentHostSingleBuffered::DestroyTextures()
|
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 13:20:52 +04:00
|
|
|
{
|
|
|
|
MOZ_ASSERT(!mNewFrontHost || mNewFrontHost->GetDeAllocator(),
|
|
|
|
"We won't be able to destroy our SurfaceDescriptor");
|
2013-04-22 06:40:52 +04:00
|
|
|
MOZ_ASSERT(!mNewFrontHostOnWhite || mNewFrontHostOnWhite->GetDeAllocator(),
|
|
|
|
"We won't be able to destroy our SurfaceDescriptor");
|
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 13:20:52 +04:00
|
|
|
mNewFrontHost = nullptr;
|
2013-04-22 06:40:52 +04:00
|
|
|
mNewFrontHostOnWhite = 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 13:20:52 +04:00
|
|
|
|
2013-07-09 01:30:44 +04:00
|
|
|
// don't touch mDeprecatedTextureHost, we might need it for compositing
|
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 13:20:52 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2013-12-05 22:39:22 +04:00
|
|
|
DeprecatedContentHostSingleBuffered::UpdateThebes(const ThebesBufferData& aData,
|
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 13:20:52 +04:00
|
|
|
const nsIntRegion& aUpdated,
|
|
|
|
const nsIntRegion& aOldValidRegionBack,
|
|
|
|
nsIntRegion* aUpdatedRegionBack)
|
|
|
|
{
|
|
|
|
aUpdatedRegionBack->SetEmpty();
|
|
|
|
|
2013-07-09 01:30:44 +04:00
|
|
|
if (!mDeprecatedTextureHost && !mNewFrontHost) {
|
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 13:20:52 +04:00
|
|
|
mInitialised = false;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (mNewFrontHost) {
|
|
|
|
DestroyFrontHost();
|
2013-07-09 01:30:44 +04:00
|
|
|
mDeprecatedTextureHost = mNewFrontHost;
|
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 13:20:52 +04:00
|
|
|
mNewFrontHost = nullptr;
|
2013-04-22 06:40:52 +04:00
|
|
|
if (mNewFrontHostOnWhite) {
|
2013-07-09 01:30:44 +04:00
|
|
|
mDeprecatedTextureHostOnWhite = mNewFrontHostOnWhite;
|
2013-04-22 06:40:52 +04:00
|
|
|
mNewFrontHostOnWhite = 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 13:20:52 +04:00
|
|
|
}
|
|
|
|
|
2013-07-09 01:30:44 +04:00
|
|
|
MOZ_ASSERT(mDeprecatedTextureHost);
|
2013-04-22 06:40:52 +04:00
|
|
|
MOZ_ASSERT(!mNewFrontHostOnWhite, "New white host without a new black?");
|
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 13:20:52 +04:00
|
|
|
|
|
|
|
// updated is in screen coordinates. Convert it to buffer coordinates.
|
|
|
|
nsIntRegion destRegion(aUpdated);
|
|
|
|
destRegion.MoveBy(-aData.rect().TopLeft());
|
|
|
|
|
|
|
|
// Correct for rotation
|
|
|
|
destRegion.MoveBy(aData.rotation());
|
|
|
|
|
2013-12-31 13:06:12 +04:00
|
|
|
IntSize size = aData.rect().Size().ToIntSize();
|
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 13:20:52 +04:00
|
|
|
nsIntRect destBounds = destRegion.GetBounds();
|
|
|
|
destRegion.MoveBy((destBounds.x >= size.width) ? -size.width : 0,
|
|
|
|
(destBounds.y >= size.height) ? -size.height : 0);
|
|
|
|
|
|
|
|
// There's code to make sure that updated regions don't cross rotation
|
|
|
|
// boundaries, so assert here that this is the case
|
|
|
|
MOZ_ASSERT((destBounds.x % size.width) + destBounds.width <= size.width,
|
|
|
|
"updated region lies across rotation boundaries!");
|
|
|
|
MOZ_ASSERT((destBounds.y % size.height) + destBounds.height <= size.height,
|
|
|
|
"updated region lies across rotation boundaries!");
|
|
|
|
|
2013-09-24 05:14:12 +04:00
|
|
|
mDeprecatedTextureHost->Update(*mDeprecatedTextureHost->LockSurfaceDescriptor(), &destRegion);
|
2013-07-09 01:30:44 +04:00
|
|
|
if (mDeprecatedTextureHostOnWhite) {
|
2013-09-24 05:14:12 +04:00
|
|
|
mDeprecatedTextureHostOnWhite->Update(*mDeprecatedTextureHostOnWhite->LockSurfaceDescriptor(), &destRegion);
|
2013-04-22 06:40:52 +04: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 13:20:52 +04:00
|
|
|
mInitialised = true;
|
|
|
|
|
|
|
|
mBufferRect = aData.rect();
|
|
|
|
mBufferRotation = aData.rotation();
|
|
|
|
}
|
|
|
|
|
2013-12-05 22:39:22 +04:00
|
|
|
void
|
|
|
|
ContentHostDoubleBuffered::UpdateThebes(const ThebesBufferData& aData,
|
|
|
|
const nsIntRegion& aUpdated,
|
|
|
|
const nsIntRegion& aOldValidRegionBack,
|
|
|
|
nsIntRegion* aUpdatedRegionBack)
|
|
|
|
{
|
|
|
|
if (!mTextureHost) {
|
|
|
|
mInitialised = false;
|
|
|
|
|
|
|
|
*aUpdatedRegionBack = aUpdated;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// 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;
|
|
|
|
}
|
|
|
|
|
|
|
|
DeprecatedContentHostDoubleBuffered::~DeprecatedContentHostDoubleBuffered()
|
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 13:20:52 +04:00
|
|
|
{
|
|
|
|
DestroyTextures();
|
|
|
|
DestroyFrontHost();
|
|
|
|
}
|
|
|
|
|
2013-04-24 18:32:43 +04:00
|
|
|
void
|
2013-12-05 22:39:22 +04:00
|
|
|
DeprecatedContentHostDoubleBuffered::EnsureDeprecatedTextureHost(TextureIdentifier aTextureId,
|
2013-04-12 11:28:55 +04:00
|
|
|
const SurfaceDescriptor& aSurface,
|
|
|
|
ISurfaceAllocator* aAllocator,
|
|
|
|
const TextureInfo& aTextureInfo)
|
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 13:20:52 +04:00
|
|
|
{
|
2013-07-09 01:30:44 +04:00
|
|
|
RefPtr<DeprecatedTextureHost> newHost = DeprecatedTextureHost::CreateDeprecatedTextureHost(aSurface.type(),
|
|
|
|
aTextureInfo.mDeprecatedTextureHostFlags,
|
2013-09-13 06:39:26 +04:00
|
|
|
aTextureInfo.mTextureFlags,
|
|
|
|
this);
|
2013-04-12 11:28:55 +04:00
|
|
|
|
|
|
|
newHost->SetBuffer(new SurfaceDescriptor(aSurface), aAllocator);
|
|
|
|
|
|
|
|
Compositor* compositor = GetCompositor();
|
|
|
|
if (compositor) {
|
|
|
|
newHost->SetCompositor(compositor);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (aTextureId == TextureFront) {
|
|
|
|
mNewFrontHost = newHost;
|
2013-04-24 18:32:43 +04:00
|
|
|
return;
|
2013-04-12 11:28:55 +04:00
|
|
|
}
|
2013-04-22 06:40:52 +04:00
|
|
|
if (aTextureId == TextureOnWhiteFront) {
|
|
|
|
mNewFrontHostOnWhite = newHost;
|
2013-04-24 18:32:43 +04:00
|
|
|
return;
|
2013-04-22 06:40:52 +04:00
|
|
|
}
|
2013-04-12 11:28:55 +04:00
|
|
|
if (aTextureId == TextureBack) {
|
|
|
|
mBackHost = newHost;
|
|
|
|
mBufferRect = nsIntRect();
|
|
|
|
mBufferRotation = nsIntPoint();
|
2013-04-24 18:32:43 +04:00
|
|
|
return;
|
2013-04-12 11:28:55 +04:00
|
|
|
}
|
2013-04-22 06:40:52 +04:00
|
|
|
if (aTextureId == TextureOnWhiteBack) {
|
|
|
|
mBackHostOnWhite = newHost;
|
2013-06-07 12:52:23 +04:00
|
|
|
return;
|
2013-04-22 06:40:52 +04:00
|
|
|
}
|
2013-04-12 11:28:55 +04:00
|
|
|
|
|
|
|
NS_ERROR("Bad texture identifier");
|
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 13:20:52 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2013-12-05 22:39:22 +04:00
|
|
|
DeprecatedContentHostDoubleBuffered::DestroyTextures()
|
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 13:20:52 +04:00
|
|
|
{
|
|
|
|
if (mNewFrontHost) {
|
|
|
|
MOZ_ASSERT(mNewFrontHost->GetDeAllocator(),
|
|
|
|
"We won't be able to destroy our SurfaceDescriptor");
|
|
|
|
mNewFrontHost = nullptr;
|
|
|
|
}
|
2013-04-22 06:40:52 +04:00
|
|
|
if (mNewFrontHostOnWhite) {
|
|
|
|
MOZ_ASSERT(mNewFrontHostOnWhite->GetDeAllocator(),
|
|
|
|
"We won't be able to destroy our SurfaceDescriptor");
|
|
|
|
mNewFrontHostOnWhite = 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 13:20:52 +04:00
|
|
|
if (mBackHost) {
|
|
|
|
MOZ_ASSERT(mBackHost->GetDeAllocator(),
|
|
|
|
"We won't be able to destroy our SurfaceDescriptor");
|
|
|
|
mBackHost = nullptr;
|
|
|
|
}
|
2013-04-22 06:40:52 +04:00
|
|
|
if (mBackHostOnWhite) {
|
|
|
|
MOZ_ASSERT(mBackHostOnWhite->GetDeAllocator(),
|
|
|
|
"We won't be able to destroy our SurfaceDescriptor");
|
|
|
|
mBackHostOnWhite = nullptr;
|
|
|
|
}
|
|
|
|
|
2013-07-09 01:30:44 +04:00
|
|
|
// don't touch mDeprecatedTextureHost, we might need it for compositing
|
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 13:20:52 +04:00
|
|
|
}
|
2013-09-27 13:48:42 +04: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 13:20:52 +04:00
|
|
|
void
|
2013-12-05 22:39:22 +04:00
|
|
|
DeprecatedContentHostDoubleBuffered::UpdateThebes(const ThebesBufferData& aData,
|
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 13:20:52 +04:00
|
|
|
const nsIntRegion& aUpdated,
|
|
|
|
const nsIntRegion& aOldValidRegionBack,
|
|
|
|
nsIntRegion* aUpdatedRegionBack)
|
|
|
|
{
|
2013-07-09 01:30:44 +04:00
|
|
|
if (!mDeprecatedTextureHost && !mNewFrontHost) {
|
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 13:20:52 +04:00
|
|
|
mInitialised = false;
|
|
|
|
|
|
|
|
*aUpdatedRegionBack = aUpdated;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (mNewFrontHost) {
|
|
|
|
DestroyFrontHost();
|
2013-07-09 01:30:44 +04:00
|
|
|
mDeprecatedTextureHost = mNewFrontHost;
|
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 13:20:52 +04:00
|
|
|
mNewFrontHost = nullptr;
|
2013-04-22 06:40:52 +04:00
|
|
|
if (mNewFrontHostOnWhite) {
|
2013-07-09 01:30:44 +04:00
|
|
|
mDeprecatedTextureHostOnWhite = mNewFrontHostOnWhite;
|
2013-04-22 06:40:52 +04:00
|
|
|
mNewFrontHostOnWhite = 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 13:20:52 +04:00
|
|
|
}
|
|
|
|
|
2013-07-09 01:30:44 +04:00
|
|
|
MOZ_ASSERT(mDeprecatedTextureHost);
|
2013-04-22 06:40:52 +04:00
|
|
|
MOZ_ASSERT(!mNewFrontHostOnWhite, "New white host without a new black?");
|
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 13:20:52 +04:00
|
|
|
MOZ_ASSERT(mBackHost);
|
|
|
|
|
2013-07-09 01:30:44 +04:00
|
|
|
RefPtr<DeprecatedTextureHost> oldFront = mDeprecatedTextureHost;
|
|
|
|
mDeprecatedTextureHost = mBackHost;
|
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 13:20:52 +04:00
|
|
|
mBackHost = oldFront;
|
|
|
|
|
2013-07-09 01:30:44 +04:00
|
|
|
oldFront = mDeprecatedTextureHostOnWhite;
|
|
|
|
mDeprecatedTextureHostOnWhite = mBackHostOnWhite;
|
2013-04-22 06:40:52 +04:00
|
|
|
mBackHostOnWhite = oldFront;
|
|
|
|
|
2013-09-24 05:14:12 +04:00
|
|
|
mDeprecatedTextureHost->Update(*mDeprecatedTextureHost->LockSurfaceDescriptor());
|
2013-07-09 01:30:44 +04:00
|
|
|
if (mDeprecatedTextureHostOnWhite) {
|
2013-09-24 05:14:12 +04:00
|
|
|
mDeprecatedTextureHostOnWhite->Update(*mDeprecatedTextureHostOnWhite->LockSurfaceDescriptor());
|
2013-04-22 06:40:52 +04: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 13:20:52 +04:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2013-05-16 07:45:43 +04:00
|
|
|
void
|
2013-07-09 01:30:44 +04:00
|
|
|
ContentHostIncremental::EnsureDeprecatedTextureHostIncremental(ISurfaceAllocator* aAllocator,
|
2013-05-31 08:36:19 +04:00
|
|
|
const TextureInfo& aTextureInfo,
|
|
|
|
const nsIntRect& aBufferRect)
|
2013-05-16 07:45:43 +04:00
|
|
|
{
|
|
|
|
mUpdateList.AppendElement(new TextureCreationRequest(aTextureInfo,
|
|
|
|
aBufferRect));
|
|
|
|
mDeAllocator = aAllocator;
|
2013-11-15 03:56:42 +04:00
|
|
|
FlushUpdateQueue();
|
2013-05-16 07:45:43 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
ContentHostIncremental::UpdateIncremental(TextureIdentifier aTextureId,
|
|
|
|
SurfaceDescriptor& aSurface,
|
|
|
|
const nsIntRegion& aUpdated,
|
|
|
|
const nsIntRect& aBufferRect,
|
|
|
|
const nsIntPoint& aBufferRotation)
|
|
|
|
{
|
2013-05-22 07:36:38 +04:00
|
|
|
mUpdateList.AppendElement(new TextureUpdateRequest(mDeAllocator,
|
|
|
|
aTextureId,
|
2013-05-16 07:45:43 +04:00
|
|
|
aSurface,
|
|
|
|
aUpdated,
|
|
|
|
aBufferRect,
|
|
|
|
aBufferRotation));
|
2013-11-15 03:56:42 +04: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-16 07:45:43 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
ContentHostIncremental::ProcessTextureUpdates()
|
|
|
|
{
|
|
|
|
for (uint32_t i = 0; i < mUpdateList.Length(); i++) {
|
|
|
|
mUpdateList[i]->Execute(this);
|
|
|
|
}
|
|
|
|
mUpdateList.Clear();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
ContentHostIncremental::TextureCreationRequest::Execute(ContentHostIncremental* aHost)
|
|
|
|
{
|
2013-07-09 01:30:44 +04:00
|
|
|
RefPtr<DeprecatedTextureHost> newHost =
|
|
|
|
DeprecatedTextureHost::CreateDeprecatedTextureHost(SurfaceDescriptor::TShmem,
|
|
|
|
mTextureInfo.mDeprecatedTextureHostFlags,
|
2013-09-13 06:39:26 +04:00
|
|
|
mTextureInfo.mTextureFlags,
|
|
|
|
nullptr);
|
2013-05-16 07:45:43 +04:00
|
|
|
Compositor* compositor = aHost->GetCompositor();
|
|
|
|
if (compositor) {
|
|
|
|
newHost->SetCompositor(compositor);
|
|
|
|
}
|
2013-07-09 01:30:44 +04:00
|
|
|
RefPtr<DeprecatedTextureHost> newHostOnWhite;
|
2013-08-06 21:36:35 +04:00
|
|
|
if (mTextureInfo.mTextureFlags & TEXTURE_COMPONENT_ALPHA) {
|
2013-05-16 07:45:43 +04:00
|
|
|
newHostOnWhite =
|
2013-07-09 01:30:44 +04:00
|
|
|
DeprecatedTextureHost::CreateDeprecatedTextureHost(SurfaceDescriptor::TShmem,
|
|
|
|
mTextureInfo.mDeprecatedTextureHostFlags,
|
2013-09-13 06:39:26 +04:00
|
|
|
mTextureInfo.mTextureFlags,
|
|
|
|
nullptr);
|
2013-05-16 07:45:43 +04:00
|
|
|
Compositor* compositor = aHost->GetCompositor();
|
|
|
|
if (compositor) {
|
|
|
|
newHostOnWhite->SetCompositor(compositor);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-07-09 01:30:44 +04:00
|
|
|
if (mTextureInfo.mDeprecatedTextureHostFlags & TEXTURE_HOST_COPY_PREVIOUS) {
|
2013-05-16 07:45:43 +04: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());
|
|
|
|
|
|
|
|
newHost->EnsureBuffer(mBufferRect.Size(),
|
2013-07-09 01:30:44 +04:00
|
|
|
ContentForFormat(aHost->mDeprecatedTextureHost->GetFormat()));
|
2013-05-16 07:45:43 +04:00
|
|
|
|
2013-07-09 01:30:44 +04:00
|
|
|
aHost->mDeprecatedTextureHost->CopyTo(srcRect, newHost, dstRect);
|
2013-05-16 07:45:43 +04: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())
|
2013-07-09 01:30:44 +04:00
|
|
|
aHost->mDeprecatedTextureHost->CopyTo(srcRectDrawTopRight,
|
2013-05-16 07:45:43 +04:00
|
|
|
newHost, dstRectDrawTopRight);
|
|
|
|
if (!srcRectDrawTopLeft.IsEmpty())
|
2013-07-09 01:30:44 +04:00
|
|
|
aHost->mDeprecatedTextureHost->CopyTo(srcRectDrawTopLeft,
|
2013-05-16 07:45:43 +04:00
|
|
|
newHost, dstRectDrawTopLeft);
|
|
|
|
if (!srcRectDrawBottomLeft.IsEmpty())
|
2013-07-09 01:30:44 +04:00
|
|
|
aHost->mDeprecatedTextureHost->CopyTo(srcRectDrawBottomLeft,
|
2013-05-16 07:45:43 +04:00
|
|
|
newHost, dstRectDrawBottomLeft);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (newHostOnWhite) {
|
|
|
|
newHostOnWhite->EnsureBuffer(mBufferRect.Size(),
|
2013-07-09 01:30:44 +04:00
|
|
|
ContentForFormat(aHost->mDeprecatedTextureHostOnWhite->GetFormat()));
|
|
|
|
aHost->mDeprecatedTextureHostOnWhite->CopyTo(srcRect, newHostOnWhite, dstRect);
|
2013-05-16 07:45:43 +04:00
|
|
|
if (bufferRotation != nsIntPoint(0, 0)) {
|
|
|
|
// draw the remaining quadrants
|
|
|
|
if (!srcRectDrawTopRight.IsEmpty())
|
2013-07-09 01:30:44 +04:00
|
|
|
aHost->mDeprecatedTextureHostOnWhite->CopyTo(srcRectDrawTopRight,
|
2013-05-16 07:45:43 +04:00
|
|
|
newHostOnWhite, dstRectDrawTopRight);
|
|
|
|
if (!srcRectDrawTopLeft.IsEmpty())
|
2013-07-09 01:30:44 +04:00
|
|
|
aHost->mDeprecatedTextureHostOnWhite->CopyTo(srcRectDrawTopLeft,
|
2013-05-16 07:45:43 +04:00
|
|
|
newHostOnWhite, dstRectDrawTopLeft);
|
|
|
|
if (!srcRectDrawBottomLeft.IsEmpty())
|
2013-07-09 01:30:44 +04:00
|
|
|
aHost->mDeprecatedTextureHostOnWhite->CopyTo(srcRectDrawBottomLeft,
|
2013-05-16 07:45:43 +04:00
|
|
|
newHostOnWhite, dstRectDrawBottomLeft);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-07-09 01:30:44 +04:00
|
|
|
aHost->mDeprecatedTextureHost = newHost;
|
|
|
|
aHost->mDeprecatedTextureHostOnWhite = newHostOnWhite;
|
2013-05-16 07:45:43 +04: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));
|
|
|
|
|
|
|
|
nsIntPoint offset = -mUpdated.GetBounds().TopLeft();
|
|
|
|
|
|
|
|
if (mTextureId == TextureFront) {
|
2013-07-09 01:30:44 +04:00
|
|
|
aHost->mDeprecatedTextureHost->Update(mDescriptor, &mUpdated, &offset);
|
2013-05-16 07:45:43 +04:00
|
|
|
} else {
|
2013-07-09 01:30:44 +04:00
|
|
|
aHost->mDeprecatedTextureHostOnWhite->Update(mDescriptor, &mUpdated, &offset);
|
2013-05-16 07:45:43 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-11-28 01:16:34 +04:00
|
|
|
void
|
2013-12-05 22:39:22 +04:00
|
|
|
ContentHostBase::PrintInfo(nsACString& aTo, const char* aPrefix)
|
|
|
|
{
|
|
|
|
aTo += aPrefix;
|
|
|
|
aTo += nsPrintfCString("ContentHost (0x%p)", this);
|
|
|
|
|
|
|
|
AppendToString(aTo, mBufferRect, " [buffer-rect=", "]");
|
|
|
|
AppendToString(aTo, mBufferRotation, " [buffer-rotation=", "]");
|
|
|
|
if (PaintWillResample()) {
|
|
|
|
aTo += " [paint-will-resample]";
|
|
|
|
}
|
|
|
|
|
|
|
|
nsAutoCString pfx(aPrefix);
|
|
|
|
pfx += " ";
|
|
|
|
|
|
|
|
if (mTextureHost) {
|
|
|
|
aTo += "\n";
|
|
|
|
mTextureHost->PrintInfo(aTo, pfx.get());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
DeprecatedContentHostSingleBuffered::PrintInfo(nsACString& aTo, const char* aPrefix)
|
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 13:20:52 +04:00
|
|
|
{
|
|
|
|
aTo += aPrefix;
|
2013-12-05 22:39:22 +04:00
|
|
|
aTo += nsPrintfCString("DeprecatedContentHostSingleBuffered (0x%p)", this);
|
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 13:20:52 +04:00
|
|
|
|
|
|
|
AppendToString(aTo, mBufferRect, " [buffer-rect=", "]");
|
|
|
|
AppendToString(aTo, mBufferRotation, " [buffer-rotation=", "]");
|
|
|
|
if (PaintWillResample()) {
|
|
|
|
aTo += " [paint-will-resample]";
|
|
|
|
}
|
|
|
|
|
|
|
|
nsAutoCString pfx(aPrefix);
|
|
|
|
pfx += " ";
|
|
|
|
|
2013-07-09 01:30:44 +04:00
|
|
|
if (mDeprecatedTextureHost) {
|
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 13:20:52 +04:00
|
|
|
aTo += "\n";
|
2013-07-09 01:30:44 +04:00
|
|
|
mDeprecatedTextureHost->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 13:20:52 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2013-12-05 22:39:22 +04:00
|
|
|
DeprecatedContentHostDoubleBuffered::PrintInfo(nsACString& aTo, const char* aPrefix)
|
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 13:20:52 +04:00
|
|
|
{
|
|
|
|
aTo += aPrefix;
|
2013-12-05 22:39:22 +04:00
|
|
|
aTo += nsPrintfCString("DeprecatedContentHostDoubleBuffered (0x%p)", this);
|
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 13:20:52 +04:00
|
|
|
|
|
|
|
AppendToString(aTo, mBufferRect, " [buffer-rect=", "]");
|
|
|
|
AppendToString(aTo, mBufferRotation, " [buffer-rotation=", "]");
|
|
|
|
if (PaintWillResample()) {
|
|
|
|
aTo += " [paint-will-resample]";
|
|
|
|
}
|
|
|
|
|
|
|
|
nsAutoCString prefix(aPrefix);
|
|
|
|
prefix += " ";
|
|
|
|
|
2013-07-09 01:30:44 +04:00
|
|
|
if (mDeprecatedTextureHost) {
|
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 13:20:52 +04:00
|
|
|
aTo += "\n";
|
2013-07-09 01:30:44 +04:00
|
|
|
mDeprecatedTextureHost->PrintInfo(aTo, prefix.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 13:20:52 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
if (mBackHost) {
|
|
|
|
aTo += "\n";
|
|
|
|
mBackHost->PrintInfo(aTo, prefix.get());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-08-08 16:53:12 +04:00
|
|
|
#ifdef MOZ_DUMP_PAINTING
|
2013-05-26 06:44:24 +04:00
|
|
|
void
|
2013-12-05 22:39:22 +04:00
|
|
|
DeprecatedContentHostDoubleBuffered::Dump(FILE* aFile,
|
2013-05-26 06:44:24 +04:00
|
|
|
const char* aPrefix,
|
|
|
|
bool aDumpHtml)
|
|
|
|
{
|
2013-12-05 22:39:22 +04:00
|
|
|
DeprecatedContentHostBase::Dump(aFile, aPrefix, aDumpHtml);
|
2013-09-10 04:08:42 +04:00
|
|
|
if (!aDumpHtml) {
|
|
|
|
return;
|
|
|
|
}
|
2013-05-26 06:44:24 +04:00
|
|
|
if (!aFile) {
|
|
|
|
aFile = stderr;
|
|
|
|
}
|
2013-11-24 02:44:18 +04:00
|
|
|
fprintf_stderr(aFile, "<ul>");
|
2013-05-26 06:44:24 +04:00
|
|
|
if (mBackHost) {
|
2013-11-24 02:44:18 +04:00
|
|
|
fprintf_stderr(aFile, "%s", aPrefix);
|
|
|
|
fprintf_stderr(aFile, "<li> <a href=");
|
2013-07-09 01:30:44 +04:00
|
|
|
DumpDeprecatedTextureHost(aFile, mBackHost);
|
2013-11-24 02:44:18 +04:00
|
|
|
fprintf_stderr(aFile, " >Back buffer</a></li>");
|
2013-05-26 06:44:24 +04:00
|
|
|
}
|
|
|
|
if (mBackHostOnWhite) {
|
2013-11-24 02:44:18 +04:00
|
|
|
fprintf_stderr(aFile, "%s", aPrefix);
|
|
|
|
fprintf_stderr(aFile, "<li> <a href=");
|
2013-07-09 01:30:44 +04:00
|
|
|
DumpDeprecatedTextureHost(aFile, mBackHostOnWhite);
|
2013-11-24 02:44:18 +04:00
|
|
|
fprintf_stderr(aFile, " >Back buffer on white</a> </li>");
|
2013-05-26 06:44:24 +04:00
|
|
|
}
|
2013-11-24 02:44:18 +04:00
|
|
|
fprintf_stderr(aFile, "</ul>");
|
2013-05-26 06:44:24 +04:00
|
|
|
}
|
2013-08-08 16:53:12 +04: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 13:20:52 +04:00
|
|
|
|
2013-11-28 01:16:34 +04:00
|
|
|
LayerRenderState
|
2013-11-28 01:16:35 +04:00
|
|
|
ContentHostBase::GetRenderState()
|
2013-12-05 22:39:22 +04:00
|
|
|
{
|
|
|
|
if (!mTextureHost) {
|
|
|
|
return LayerRenderState();
|
|
|
|
}
|
|
|
|
|
|
|
|
LayerRenderState result = mTextureHost->GetRenderState();
|
|
|
|
|
|
|
|
if (mBufferRotation != nsIntPoint()) {
|
|
|
|
result.mFlags |= LAYER_RENDER_STATE_BUFFER_ROTATION;
|
|
|
|
}
|
|
|
|
result.SetOffset(GetOriginOffset());
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
LayerRenderState
|
|
|
|
DeprecatedContentHostBase::GetRenderState()
|
2013-07-30 13:59:51 +04:00
|
|
|
{
|
|
|
|
LayerRenderState result = mDeprecatedTextureHost->GetRenderState();
|
|
|
|
|
|
|
|
if (mBufferRotation != nsIntPoint()) {
|
|
|
|
result.mFlags |= LAYER_RENDER_STATE_BUFFER_ROTATION;
|
|
|
|
}
|
|
|
|
result.SetOffset(GetOriginOffset());
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef MOZ_DUMP_PAINTING
|
2013-11-28 01:16:34 +04:00
|
|
|
TemporaryRef<gfx::DataSourceSurface>
|
2013-11-28 01:16:35 +04:00
|
|
|
ContentHostBase::GetAsSurface()
|
2013-12-05 22:39:22 +04:00
|
|
|
{
|
|
|
|
if (!mTextureHost) {
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
return mTextureHost->GetAsSurface();
|
|
|
|
}
|
|
|
|
|
|
|
|
TemporaryRef<gfx::DataSourceSurface>
|
|
|
|
DeprecatedContentHostBase::GetAsSurface()
|
2013-07-30 13:59:51 +04:00
|
|
|
{
|
|
|
|
return mDeprecatedTextureHost->GetAsSurface();
|
|
|
|
}
|
|
|
|
#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 13:20:52 +04:00
|
|
|
} // namespace
|
|
|
|
} // namespace
|