| Index: Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h
|
| ===================================================================
|
| --- Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h (revision 112692)
|
| +++ Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h (working copy)
|
| @@ -61,6 +61,7 @@
|
| class GeometryBinding;
|
| class GraphicsContext3D;
|
| class LayerRendererSwapBuffersCompleteCallbackAdapter;
|
| +class LayerRendererGpuMemoryAllocationChangedCallbackAdapter;
|
| class ScopedEnsureFramebufferAllocation;
|
|
|
| class LayerRendererChromiumClient {
|
| @@ -163,11 +164,12 @@
|
| float width, float height, float opacity, const FloatQuad&,
|
| int matrixLocation, int alphaLocation, int quadLocation);
|
|
|
| +protected:
|
| + friend class LayerRendererGpuMemoryAllocationChangedCallbackAdapter;
|
| void discardFramebuffer();
|
| void ensureFramebuffer();
|
| bool isFramebufferDiscarded() const { return m_isFramebufferDiscarded; }
|
|
|
| -protected:
|
| LayerRendererChromium(LayerRendererChromiumClient*, PassRefPtr<GraphicsContext3D>);
|
| bool initialize();
|
|
|
| @@ -266,34 +268,7 @@
|
| bool m_isFramebufferDiscarded;
|
| };
|
|
|
| -// The purpose of this helper is twofold:
|
| -// 1. To ensure that a framebuffer is available for scope lifetime, and
|
| -// 2. To reset framebuffer allocation to previous state on scope exit.
|
| -// If the framebuffer is recreated, its contents are undefined.
|
| -// FIXME: Prevent/delay discarding framebuffer via any means while any
|
| -// instance of this is alive. At the moment, this isn't an issue.
|
| -class ScopedEnsureFramebufferAllocation {
|
| -public:
|
| - explicit ScopedEnsureFramebufferAllocation(LayerRendererChromium* layerRenderer)
|
| - : m_layerRenderer(layerRenderer)
|
| - , m_framebufferWasInitiallyDiscarded(layerRenderer->isFramebufferDiscarded())
|
| - {
|
| - if (m_framebufferWasInitiallyDiscarded)
|
| - m_layerRenderer->ensureFramebuffer();
|
| - }
|
|
|
| - ~ScopedEnsureFramebufferAllocation()
|
| - {
|
| - if (m_framebufferWasInitiallyDiscarded)
|
| - m_layerRenderer->discardFramebuffer();
|
| - }
|
| -
|
| -private:
|
| - LayerRendererChromium* m_layerRenderer;
|
| - bool m_framebufferWasInitiallyDiscarded;
|
| -};
|
| -
|
| -
|
| // Setting DEBUG_GL_CALLS to 1 will call glGetError() after almost every GL
|
| // call made by the compositor. Useful for debugging rendering issues but
|
| // will significantly degrade performance.
|
|
|