Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#ifndef MOZILLA_GFX_TILEDCONTENTCLIENT_H
|
|
|
|
#define MOZILLA_GFX_TILEDCONTENTCLIENT_H
|
|
|
|
|
2013-08-11 16:17:23 -07:00
|
|
|
#include <stddef.h> // for size_t
|
|
|
|
#include <stdint.h> // for uint16_t
|
|
|
|
#include <algorithm> // for swap
|
|
|
|
#include "Layers.h" // for LayerManager, etc
|
|
|
|
#include "TiledLayerBuffer.h" // for TiledLayerBuffer
|
|
|
|
#include "Units.h" // for CSSPoint
|
|
|
|
#include "gfx3DMatrix.h" // for gfx3DMatrix
|
2013-09-24 13:45:14 -07:00
|
|
|
#include "gfxTypes.h"
|
2013-08-11 16:17:23 -07:00
|
|
|
#include "mozilla/Attributes.h" // for MOZ_OVERRIDE
|
|
|
|
#include "mozilla/RefPtr.h" // for RefPtr
|
|
|
|
#include "mozilla/layers/CompositableClient.h" // for CompositableClient
|
|
|
|
#include "mozilla/layers/CompositorTypes.h" // for TextureInfo, etc
|
|
|
|
#include "mozilla/layers/TextureClient.h"
|
|
|
|
#include "mozilla/mozalloc.h" // for operator delete
|
|
|
|
#include "nsAutoPtr.h" // for nsRefPtr
|
|
|
|
#include "nsPoint.h" // for nsIntPoint
|
|
|
|
#include "nsRect.h" // for nsIntRect
|
|
|
|
#include "nsRegion.h" // for nsIntRegion
|
|
|
|
#include "nsTArray.h" // for nsTArray, nsTArray_Impl, etc
|
|
|
|
#include "nsTraceRefcnt.h" // for MOZ_COUNT_DTOR
|
2013-08-19 06:59:22 -07:00
|
|
|
#include "mozilla/layers/ISurfaceAllocator.h"
|
2013-08-11 16:17:23 -07:00
|
|
|
#include "gfxReusableSurfaceWrapper.h"
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
|
2013-09-24 13:45:14 -07:00
|
|
|
class gfxImageSurface;
|
|
|
|
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
namespace mozilla {
|
|
|
|
namespace layers {
|
|
|
|
|
2013-08-19 06:59:22 -07:00
|
|
|
class BasicTileDescriptor;
|
|
|
|
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
/**
|
|
|
|
* Represent a single tile in tiled buffer. The buffer keeps tiles,
|
|
|
|
* each tile keeps a reference to a texture client. The texture client
|
|
|
|
* is backed by a gfxReusableSurfaceWrapper that implements a
|
|
|
|
* copy-on-write mechanism while locked. The tile should be
|
|
|
|
* locked before being sent to the compositor and unlocked
|
|
|
|
* as soon as it is uploaded to prevent a copy.
|
|
|
|
* Ideal place to store per tile debug information.
|
|
|
|
*/
|
|
|
|
struct BasicTiledLayerTile {
|
2013-07-08 14:30:44 -07:00
|
|
|
RefPtr<DeprecatedTextureClientTile> mDeprecatedTextureClient;
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
#ifdef GFX_TILEDLAYER_DEBUG_OVERLAY
|
|
|
|
TimeStamp mLastUpdate;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// Placeholder
|
|
|
|
BasicTiledLayerTile()
|
2013-07-08 14:30:44 -07:00
|
|
|
: mDeprecatedTextureClient(nullptr)
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
{}
|
|
|
|
|
2013-08-19 06:59:22 -07:00
|
|
|
BasicTiledLayerTile(DeprecatedTextureClientTile* aTextureClient)
|
|
|
|
: mDeprecatedTextureClient(aTextureClient)
|
|
|
|
{}
|
|
|
|
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
BasicTiledLayerTile(const BasicTiledLayerTile& o) {
|
2013-07-08 14:30:44 -07:00
|
|
|
mDeprecatedTextureClient = o.mDeprecatedTextureClient;
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
#ifdef GFX_TILEDLAYER_DEBUG_OVERLAY
|
|
|
|
mLastUpdate = o.mLastUpdate;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
BasicTiledLayerTile& operator=(const BasicTiledLayerTile& o) {
|
|
|
|
if (this == &o) return *this;
|
2013-07-08 14:30:44 -07:00
|
|
|
mDeprecatedTextureClient = o.mDeprecatedTextureClient;
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
#ifdef GFX_TILEDLAYER_DEBUG_OVERLAY
|
|
|
|
mLastUpdate = o.mLastUpdate;
|
|
|
|
#endif
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
bool operator== (const BasicTiledLayerTile& o) const {
|
2013-07-08 14:30:44 -07:00
|
|
|
return mDeprecatedTextureClient == o.mDeprecatedTextureClient;
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
}
|
|
|
|
bool operator!= (const BasicTiledLayerTile& o) const {
|
2013-07-08 14:30:44 -07:00
|
|
|
return mDeprecatedTextureClient != o.mDeprecatedTextureClient;
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
}
|
|
|
|
|
2013-07-08 14:30:44 -07:00
|
|
|
bool IsPlaceholderTile() { return mDeprecatedTextureClient == nullptr; }
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
|
|
|
|
void ReadUnlock() {
|
|
|
|
GetSurface()->ReadUnlock();
|
|
|
|
}
|
|
|
|
void ReadLock() {
|
|
|
|
GetSurface()->ReadLock();
|
|
|
|
}
|
|
|
|
|
2013-08-19 06:59:27 -07:00
|
|
|
TileDescriptor GetTileDescriptor();
|
|
|
|
static BasicTiledLayerTile OpenDescriptor(ISurfaceAllocator *aAllocator, const TileDescriptor& aDesc);
|
2013-08-19 06:59:22 -07:00
|
|
|
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
gfxReusableSurfaceWrapper* GetSurface() {
|
2013-07-08 14:30:44 -07:00
|
|
|
return mDeprecatedTextureClient->GetReusableSurfaceWrapper();
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This struct stores all the data necessary to perform a paint so that it
|
|
|
|
* doesn't need to be recalculated on every repeated transaction.
|
|
|
|
*/
|
|
|
|
struct BasicTiledLayerPaintData {
|
2013-11-27 09:33:27 -08:00
|
|
|
/*
|
|
|
|
* The scroll offset of the content from the nearest ancestor layer that
|
|
|
|
* represents scrollable content with a display port set.
|
|
|
|
*/
|
|
|
|
ScreenPoint mScrollOffset;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The scroll offset of the content from the nearest ancestor layer that
|
|
|
|
* represents scrollable content with a display port set, for the last
|
|
|
|
* layer update transaction.
|
|
|
|
*/
|
|
|
|
ScreenPoint mLastScrollOffset;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The transform matrix to go from Screen units to transformed LayoutDevice
|
|
|
|
* units.
|
|
|
|
*/
|
|
|
|
gfx3DMatrix mTransformScreenToLayout;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The critical displayport of the content from the nearest ancestor layer
|
|
|
|
* that represents scrollable content with a display port set. Empty if a
|
|
|
|
* critical displayport is not set.
|
|
|
|
*
|
|
|
|
* This is in transformed LayoutDevice coordinates, but is stored as an
|
|
|
|
* nsIntRect for convenience when intersecting with the layer's mValidRegion.
|
|
|
|
*/
|
|
|
|
nsIntRect mLayoutCriticalDisplayPort;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The render resolution of the document that the content this layer
|
|
|
|
* represents is in.
|
|
|
|
*/
|
|
|
|
CSSToScreenScale mResolution;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The composition bounds of the primary scrollable layer, in transformed
|
|
|
|
* layout device coordinates. This is used to make sure that tiled updates to
|
|
|
|
* regions that are visible to the user are grouped coherently.
|
|
|
|
*/
|
|
|
|
LayoutDeviceRect mCompositionBounds;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Low precision updates are always executed a tile at a time in repeated
|
|
|
|
* transactions. This counter is set to 1 on the first transaction of a low
|
|
|
|
* precision update, and incremented for each subsequent transaction.
|
|
|
|
*/
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
uint16_t mLowPrecisionPaintCount;
|
2013-11-27 09:33:27 -08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Whether this is the first time this layer is painting
|
|
|
|
*/
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
bool mFirstPaint : 1;
|
2013-11-27 09:33:27 -08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Whether there is further work to complete this paint. This is used to
|
|
|
|
* determine whether or not to repeat the transaction when painting
|
|
|
|
* progressively.
|
|
|
|
*/
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
bool mPaintFinished : 1;
|
|
|
|
};
|
|
|
|
|
2013-04-30 22:03:25 -07:00
|
|
|
class ClientTiledThebesLayer;
|
|
|
|
class ClientLayerManager;
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
|
2013-12-19 12:19:25 -08:00
|
|
|
class SharedFrameMetricsHelper
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
SharedFrameMetricsHelper();
|
|
|
|
~SharedFrameMetricsHelper();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This is called by the BasicTileLayer to determine if it is still interested
|
|
|
|
* in the update of this display-port to continue. We can return true here
|
|
|
|
* to abort the current update and continue with any subsequent ones. This
|
|
|
|
* is useful for slow-to-render pages when the display-port starts lagging
|
|
|
|
* behind enough that continuing to draw it is wasted effort.
|
|
|
|
*/
|
|
|
|
bool UpdateFromCompositorFrameMetrics(ContainerLayer* aLayer,
|
|
|
|
bool aHasPendingNewThebesContent,
|
|
|
|
bool aLowPrecision,
|
|
|
|
ScreenRect& aCompositionBounds,
|
|
|
|
CSSToScreenScale& aZoom);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* When a shared FrameMetrics can not be found for a given layer,
|
|
|
|
* this function is used to find the first non-empty composition bounds
|
|
|
|
* by traversing up the layer tree.
|
|
|
|
*/
|
|
|
|
void FindFallbackContentFrameMetrics(ContainerLayer* aLayer,
|
|
|
|
ScreenRect& aCompositionBounds,
|
|
|
|
CSSToScreenScale& aZoom);
|
|
|
|
/**
|
|
|
|
* Determines if the compositor's upcoming composition bounds has fallen
|
|
|
|
* outside of the contents display port. If it has then the compositor
|
|
|
|
* will start to checker board. Checker boarding is when the compositor
|
|
|
|
* tries to composite a tile and it is not available. Historically
|
|
|
|
* a tile with a checker board pattern was used. Now a blank tile is used.
|
|
|
|
*/
|
|
|
|
bool AboutToCheckerboard(const FrameMetrics& aContentMetrics,
|
|
|
|
const FrameMetrics& aCompositorMetrics);
|
|
|
|
private:
|
|
|
|
bool mLastProgressiveUpdateWasLowPrecision;
|
|
|
|
bool mProgressiveUpdateWasInDanger;
|
|
|
|
};
|
|
|
|
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
/**
|
|
|
|
* Provide an instance of TiledLayerBuffer backed by image surfaces.
|
|
|
|
* This buffer provides an implementation to ValidateTile using a
|
|
|
|
* thebes callback and can support painting using a single paint buffer
|
|
|
|
* which is much faster then painting directly into the tiles.
|
|
|
|
*/
|
|
|
|
class BasicTiledLayerBuffer
|
|
|
|
: public TiledLayerBuffer<BasicTiledLayerBuffer, BasicTiledLayerTile>
|
|
|
|
{
|
|
|
|
friend class TiledLayerBuffer<BasicTiledLayerBuffer, BasicTiledLayerTile>;
|
|
|
|
|
|
|
|
public:
|
2013-04-30 22:03:25 -07:00
|
|
|
BasicTiledLayerBuffer(ClientTiledThebesLayer* aThebesLayer,
|
2013-12-19 12:19:25 -08:00
|
|
|
ClientLayerManager* aManager,
|
|
|
|
SharedFrameMetricsHelper* aHelper);
|
2013-04-16 14:36:06 -07:00
|
|
|
BasicTiledLayerBuffer()
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
: mThebesLayer(nullptr)
|
|
|
|
, mManager(nullptr)
|
|
|
|
, mLastPaintOpaque(false)
|
2013-12-19 12:19:25 -08:00
|
|
|
, mSharedFrameMetricsHelper(nullptr)
|
2013-04-16 14:36:06 -07:00
|
|
|
{}
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
|
2013-08-19 06:59:22 -07:00
|
|
|
BasicTiledLayerBuffer(ISurfaceAllocator* aAllocator,
|
|
|
|
const nsIntRegion& aValidRegion,
|
|
|
|
const nsIntRegion& aPaintedRegion,
|
|
|
|
const InfallibleTArray<TileDescriptor>& aTiles,
|
|
|
|
int aRetainedWidth,
|
|
|
|
int aRetainedHeight,
|
2013-12-19 12:19:25 -08:00
|
|
|
float aResolution,
|
|
|
|
SharedFrameMetricsHelper* aHelper)
|
2013-08-19 06:59:22 -07:00
|
|
|
{
|
2013-12-19 12:19:25 -08:00
|
|
|
mSharedFrameMetricsHelper = aHelper;
|
2013-08-19 06:59:22 -07:00
|
|
|
mValidRegion = aValidRegion;
|
|
|
|
mPaintedRegion = aPaintedRegion;
|
|
|
|
mRetainedWidth = aRetainedWidth;
|
|
|
|
mRetainedHeight = aRetainedHeight;
|
|
|
|
mResolution = aResolution;
|
|
|
|
|
|
|
|
for(size_t i = 0; i < aTiles.Length(); i++) {
|
|
|
|
if (aTiles[i].type() == TileDescriptor::TPlaceholderTileDescriptor) {
|
|
|
|
mRetainedTiles.AppendElement(GetPlaceholderTile());
|
|
|
|
} else {
|
2013-08-19 06:59:27 -07:00
|
|
|
mRetainedTiles.AppendElement(BasicTiledLayerTile::OpenDescriptor(aAllocator, aTiles[i]));
|
2013-08-19 06:59:22 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
void PaintThebes(const nsIntRegion& aNewValidRegion,
|
|
|
|
const nsIntRegion& aPaintRegion,
|
|
|
|
LayerManager::DrawThebesLayerCallback aCallback,
|
|
|
|
void* aCallbackData);
|
|
|
|
|
|
|
|
void ReadUnlock() {
|
|
|
|
for (size_t i = 0; i < mRetainedTiles.Length(); i++) {
|
|
|
|
if (mRetainedTiles[i].IsPlaceholderTile()) continue;
|
|
|
|
mRetainedTiles[i].ReadUnlock();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void ReadLock() {
|
|
|
|
for (size_t i = 0; i < mRetainedTiles.Length(); i++) {
|
|
|
|
if (mRetainedTiles[i].IsPlaceholderTile()) continue;
|
|
|
|
mRetainedTiles[i].ReadLock();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-11-27 09:33:27 -08:00
|
|
|
const CSSToScreenScale& GetFrameResolution() { return mFrameResolution; }
|
|
|
|
void SetFrameResolution(const CSSToScreenScale& aResolution) { mFrameResolution = aResolution; }
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
|
|
|
|
bool HasFormatChanged() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Performs a progressive update of a given tiled buffer.
|
2013-07-08 21:21:06 -07:00
|
|
|
* See ComputeProgressiveUpdateRegion below for parameter documentation.
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
*/
|
|
|
|
bool ProgressiveUpdate(nsIntRegion& aValidRegion,
|
|
|
|
nsIntRegion& aInvalidRegion,
|
|
|
|
const nsIntRegion& aOldValidRegion,
|
|
|
|
BasicTiledLayerPaintData* aPaintData,
|
|
|
|
LayerManager::DrawThebesLayerCallback aCallback,
|
|
|
|
void* aCallbackData);
|
|
|
|
|
2013-08-19 06:59:22 -07:00
|
|
|
SurfaceDescriptorTiles GetSurfaceDescriptorTiles();
|
|
|
|
|
|
|
|
static BasicTiledLayerBuffer OpenDescriptor(ISurfaceAllocator* aAllocator,
|
2013-12-19 12:19:25 -08:00
|
|
|
const SurfaceDescriptorTiles& aDescriptor,
|
|
|
|
SharedFrameMetricsHelper* aHelper);
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
|
|
|
|
protected:
|
|
|
|
BasicTiledLayerTile ValidateTile(BasicTiledLayerTile aTile,
|
|
|
|
const nsIntPoint& aTileRect,
|
|
|
|
const nsIntRegion& dirtyRect);
|
|
|
|
|
|
|
|
// If this returns true, we perform the paint operation into a single large
|
|
|
|
// buffer and copy it out to the tiles instead of calling PaintThebes() on
|
|
|
|
// each tile individually. Somewhat surprisingly, this turns out to be faster
|
|
|
|
// on Android.
|
|
|
|
bool UseSinglePaintBuffer() { return true; }
|
|
|
|
|
|
|
|
void ReleaseTile(BasicTiledLayerTile aTile) { /* No-op. */ }
|
|
|
|
|
|
|
|
void SwapTiles(BasicTiledLayerTile& aTileA, BasicTiledLayerTile& aTileB) {
|
|
|
|
std::swap(aTileA, aTileB);
|
|
|
|
}
|
|
|
|
|
|
|
|
BasicTiledLayerTile GetPlaceholderTile() const { return BasicTiledLayerTile(); }
|
2013-04-16 14:36:06 -07:00
|
|
|
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
private:
|
2013-09-24 13:45:13 -07:00
|
|
|
gfxContentType GetContentType() const;
|
2013-04-30 22:03:25 -07:00
|
|
|
ClientTiledThebesLayer* mThebesLayer;
|
|
|
|
ClientLayerManager* mManager;
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
LayerManager::DrawThebesLayerCallback mCallback;
|
|
|
|
void* mCallbackData;
|
2013-11-27 09:33:27 -08:00
|
|
|
CSSToScreenScale mFrameResolution;
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
bool mLastPaintOpaque;
|
|
|
|
|
|
|
|
// The buffer we use when UseSinglePaintBuffer() above is true.
|
|
|
|
nsRefPtr<gfxImageSurface> mSinglePaintBuffer;
|
2013-08-13 21:31:05 -07:00
|
|
|
RefPtr<gfx::DrawTarget> mSinglePaintDrawTarget;
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
nsIntPoint mSinglePaintBufferOffset;
|
2013-12-19 12:19:25 -08:00
|
|
|
SharedFrameMetricsHelper* mSharedFrameMetricsHelper;
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
|
|
|
|
BasicTiledLayerTile ValidateTileInternal(BasicTiledLayerTile aTile,
|
2013-04-16 14:36:06 -07:00
|
|
|
const nsIntPoint& aTileOrigin,
|
|
|
|
const nsIntRect& aDirtyRect);
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Calculates the region to update in a single progressive update transaction.
|
|
|
|
* This employs some heuristics to update the most 'sensible' region to
|
|
|
|
* update at this point in time, and how large an update should be performed
|
|
|
|
* at once to maintain visual coherency.
|
|
|
|
*
|
|
|
|
* aInvalidRegion is the current invalid region.
|
|
|
|
* aOldValidRegion is the valid region of mTiledBuffer at the beginning of the
|
|
|
|
* current transaction.
|
|
|
|
* aRegionToPaint will be filled with the region to update. This may be empty,
|
|
|
|
* which indicates that there is no more work to do.
|
|
|
|
* aIsRepeated should be true if this function has already been called during
|
|
|
|
* this transaction.
|
|
|
|
*
|
|
|
|
* Returns true if it should be called again, false otherwise. In the case
|
|
|
|
* that aRegionToPaint is empty, this will return aIsRepeated for convenience.
|
|
|
|
*/
|
|
|
|
bool ComputeProgressiveUpdateRegion(const nsIntRegion& aInvalidRegion,
|
|
|
|
const nsIntRegion& aOldValidRegion,
|
|
|
|
nsIntRegion& aRegionToPaint,
|
|
|
|
BasicTiledLayerPaintData* aPaintData,
|
|
|
|
bool aIsRepeated);
|
|
|
|
};
|
|
|
|
|
2013-04-16 14:36:06 -07:00
|
|
|
class TiledContentClient : public CompositableClient
|
|
|
|
{
|
|
|
|
// XXX: for now the layer which owns us interacts directly with our buffers.
|
|
|
|
// We should have a content client for each tiled buffer which manages its
|
|
|
|
// own valid region, resolution, etc. Then we could have a much cleaner
|
|
|
|
// interface and tidy up BasicTiledThebesLayer::PaintThebes (bug 862547).
|
2013-04-30 22:03:25 -07:00
|
|
|
friend class ClientTiledThebesLayer;
|
2013-04-16 14:36:06 -07:00
|
|
|
|
|
|
|
public:
|
2013-04-30 22:03:25 -07:00
|
|
|
TiledContentClient(ClientTiledThebesLayer* aThebesLayer,
|
|
|
|
ClientLayerManager* aManager);
|
2013-04-16 14:36:06 -07:00
|
|
|
|
|
|
|
~TiledContentClient()
|
|
|
|
{
|
|
|
|
MOZ_COUNT_DTOR(TiledContentClient);
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual TextureInfo GetTextureInfo() const MOZ_OVERRIDE
|
|
|
|
{
|
|
|
|
return TextureInfo(BUFFER_TILED);
|
|
|
|
}
|
|
|
|
|
|
|
|
enum TiledBufferType {
|
|
|
|
TILED_BUFFER,
|
|
|
|
LOW_PRECISION_TILED_BUFFER
|
|
|
|
};
|
|
|
|
void LockCopyAndWrite(TiledBufferType aType);
|
|
|
|
|
|
|
|
private:
|
2013-12-19 12:19:25 -08:00
|
|
|
SharedFrameMetricsHelper mSharedFrameMetricsHelper;
|
2013-04-16 14:36:06 -07:00
|
|
|
BasicTiledLayerBuffer mTiledBuffer;
|
|
|
|
BasicTiledLayerBuffer mLowPrecisionTiledBuffer;
|
|
|
|
};
|
|
|
|
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|