[chromium] Rename LayerRendererChromium to GL-specific name
authoraelias@chromium.org <aelias@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Aug 2012 20:31:46 +0000 (20:31 +0000)
committeraelias@chromium.org <aelias@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Aug 2012 20:31:46 +0000 (20:31 +0000)
https://bugs.webkit.org/show_bug.cgi?id=94835

Reviewed by James Robinson.

Over time, LayerRendererChromium has evolved to be a GL-specific
subclass of CCRenderer that has no awareness of layers (as it operates
only with drawQuads).

This patch renames LayerRendererChromium to CCRendererGL, replaces all
instances of "layerRenderer" with just "renderer", and removes a
few unnecessary includes of LayerRendererChromium.h.

Source/WebCore:

No new tests (no-op refactoring).

* WebCore.gypi:
* platform/graphics/chromium/Canvas2DLayerBridge.cpp:
* platform/graphics/chromium/ContentLayerChromium.cpp:
(WebCore::ContentLayerChromium::createTextureUpdaterIfNeeded):
* platform/graphics/chromium/GeometryBinding.cpp:
* platform/graphics/chromium/HeadsUpDisplayLayerChromium.cpp:
(WebCore::HeadsUpDisplayLayerChromium::update):
* platform/graphics/chromium/ImageLayerChromium.cpp:
(WebCore::ImageLayerChromium::createTextureUpdaterIfNeeded):
* platform/graphics/chromium/LayerTextureSubImage.cpp:
* platform/graphics/chromium/ProgramBinding.cpp:
* platform/graphics/chromium/RenderSurfaceChromium.h:
(WebCore):
* platform/graphics/chromium/ScrollbarLayerChromium.cpp:
(WebCore::ScrollbarLayerChromium::createTextureUpdaterIfNeeded):
* platform/graphics/chromium/TextureCopier.cpp:
* platform/graphics/chromium/TiledLayerChromium.cpp:
(WebCore::TiledLayerChromium::updateTileSizeAndTilingOption):
* platform/graphics/chromium/cc/CCHeadsUpDisplayLayerImpl.cpp:
* platform/graphics/chromium/cc/CCIOSurfaceLayerImpl.cpp:
* platform/graphics/chromium/cc/CCLayerImpl.cpp:
(WebCore::sortLayers):
* platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
(WebCore::CCLayerTreeHost::CCLayerTreeHost):
(WebCore::CCLayerTreeHost::initializeRenderer):
(WebCore::CCLayerTreeHost::deleteContentsTexturesOnImplThread):
(WebCore::CCLayerTreeHost::finishAllRendering):
(WebCore::CCLayerTreeHost::rendererCapabilities):
(WebCore::CCLayerTreeHost::initializeRendererIfNeeded):
(WebCore::CCLayerTreeHost::updateLayers):
* platform/graphics/chromium/cc/CCLayerTreeHost.h:
(WebCore::RendererCapabilities::RendererCapabilities):
(CCLayerTreeHost):
* platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
(WebCore::CCLayerTreeHostImpl::canDraw):
(WebCore::CCLayerTreeHostImpl::calculateRenderSurfaceLayerList):
(WebCore::CCLayerTreeHostImpl::calculateRenderPasses):
(WebCore::CCLayerTreeHostImpl::drawLayers):
(WebCore::CCLayerTreeHostImpl::finishAllRendering):
(WebCore::CCLayerTreeHostImpl::isContextLost):
(WebCore::CCLayerTreeHostImpl::rendererCapabilities):
(WebCore::CCLayerTreeHostImpl::swapBuffers):
(WebCore::CCLayerTreeHostImpl::readback):
(WebCore::CCLayerTreeHostImpl::setVisible):
(WebCore::CCLayerTreeHostImpl::initializeRenderer):
(WebCore::CCLayerTreeHostImpl::setViewportSize):
(WebCore::CCLayerTreeHostImpl::ensureRenderSurfaceLayerList):
* platform/graphics/chromium/cc/CCLayerTreeHostImpl.h:
(WebCore):
(WebCore::CCLayerTreeHostImpl::renderer):
(CCLayerTreeHostImpl):
* platform/graphics/chromium/cc/CCPrioritizedTexture.cpp:
* platform/graphics/chromium/cc/CCPrioritizedTextureManager.cpp:
* platform/graphics/chromium/cc/CCPriorityCalculator.cpp:
* platform/graphics/chromium/cc/CCProxy.h:
(WebCore):
(CCProxy):
* platform/graphics/chromium/cc/CCRenderSurface.cpp:
* platform/graphics/chromium/cc/CCRenderSurface.h:
(WebCore):
* platform/graphics/chromium/cc/CCRenderer.h:
(CCRenderer):
* platform/graphics/chromium/cc/CCRendererGL.cpp: Renamed from Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp.
(WebCore::CCRendererGL::create):
(WebCore):
(WebCore::CCRendererGL::CCRendererGL):
(WebCore::CCRendererGL::initialize):
(WebCore::CCRendererGL::~CCRendererGL):
(WebCore::CCRendererGL::context):
(WebCore::CCRendererGL::debugGLCall):
(WebCore::CCRendererGL::setVisible):
(WebCore::CCRendererGL::releaseRenderPassTextures):
(WebCore::CCRendererGL::viewportChanged):
(WebCore::CCRendererGL::clearFramebuffer):
(WebCore::CCRendererGL::beginDrawingFrame):
(WebCore::CCRendererGL::doNoOp):
(WebCore::CCRendererGL::drawQuad):
(WebCore::CCRendererGL::drawCheckerboardQuad):
(WebCore::CCRendererGL::drawDebugBorderQuad):
(WebCore::applyFilters):
(WebCore::CCRendererGL::drawBackgroundFilters):
(WebCore::CCRendererGL::drawRenderPassQuad):
(WebCore::CCRendererGL::drawSolidColorQuad):
(TileProgramUniforms):
(WebCore::tileUniformLocation):
(WebCore::CCRendererGL::drawTileQuad):
(WebCore::CCRendererGL::drawYUVVideoQuad):
(WebCore::CCRendererGL::drawStreamVideoQuad):
(WebCore::TextureProgramBinding::set):
(TextureProgramBinding):
(WebCore::TexTransformTextureProgramBinding::set):
(TexTransformTextureProgramBinding):
(WebCore::CCRendererGL::drawTextureQuad):
(WebCore::CCRendererGL::drawIOSurfaceQuad):
(WebCore::CCRendererGL::finishDrawingFrame):
(WebCore::CCRendererGL::toGLMatrix):
(WebCore::CCRendererGL::setShaderFloatQuad):
(WebCore::CCRendererGL::setShaderOpacity):
(WebCore::CCRendererGL::drawQuadGeometry):
(WebCore::CCRendererGL::copyTextureToFramebuffer):
(WebCore::CCRendererGL::finish):
(WebCore::CCRendererGL::swapBuffers):
(WebCore::CCRendererGL::onSwapBuffersComplete):
(WebCore::CCRendererGL::onMemoryAllocationChanged):
(WebCore::CCRendererGL::onMemoryAllocationChangedOnImplThread):
(WebCore::CCRendererGL::discardFramebuffer):
(WebCore::CCRendererGL::ensureFramebuffer):
(WebCore::CCRendererGL::onContextLost):
(WebCore::CCRendererGL::getFramebufferPixels):
(WebCore::CCRendererGL::getFramebufferTexture):
(WebCore::CCRendererGL::useScopedTexture):
(WebCore::CCRendererGL::bindFramebufferToOutputSurface):
(WebCore::CCRendererGL::bindFramebufferToTexture):
(WebCore::CCRendererGL::enableScissorTestRect):
(WebCore::CCRendererGL::disableScissorTest):
(WebCore::CCRendererGL::setDrawViewportSize):
(WebCore::CCRendererGL::makeContextCurrent):
(WebCore::CCRendererGL::initializeSharedObjects):
(WebCore::CCRendererGL::tileCheckerboardProgram):
(WebCore::CCRendererGL::solidColorProgram):
(WebCore::CCRendererGL::renderPassProgram):
(WebCore::CCRendererGL::renderPassProgramAA):
(WebCore::CCRendererGL::renderPassMaskProgram):
(WebCore::CCRendererGL::renderPassMaskProgramAA):
(WebCore::CCRendererGL::tileProgram):
(WebCore::CCRendererGL::tileProgramOpaque):
(WebCore::CCRendererGL::tileProgramAA):
(WebCore::CCRendererGL::tileProgramSwizzle):
(WebCore::CCRendererGL::tileProgramSwizzleOpaque):
(WebCore::CCRendererGL::tileProgramSwizzleAA):
(WebCore::CCRendererGL::textureProgram):
(WebCore::CCRendererGL::textureProgramFlip):
(WebCore::CCRendererGL::textureIOSurfaceProgram):
(WebCore::CCRendererGL::videoYUVProgram):
(WebCore::CCRendererGL::videoStreamTextureProgram):
(WebCore::CCRendererGL::cleanupSharedObjects):
(WebCore::CCRendererGL::isContextLost):
* platform/graphics/chromium/cc/CCRendererGL.h: Renamed from Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h.
(WebKit):
(WebCore):
(CCRendererGL):
(WebCore::CCRendererGL::sharedGeometryQuad):
(WebCore::CCRendererGL::sharedGeometry):
(WebCore::CCRendererGL::isFramebufferDiscarded):
* platform/graphics/chromium/cc/CCResourceProvider.cpp:
* platform/graphics/chromium/cc/CCSingleThreadProxy.cpp:
(WebCore::CCSingleThreadProxy::CCSingleThreadProxy):
(WebCore::CCSingleThreadProxy::initializeRenderer):
(WebCore::CCSingleThreadProxy::recreateContext):
(WebCore::CCSingleThreadProxy::rendererCapabilities):
(WebCore::CCSingleThreadProxy::doCommit):
(WebCore::CCSingleThreadProxy::forceSerializeOnSwapBuffers):
(WebCore::CCSingleThreadProxy::commitAndComposite):
* platform/graphics/chromium/cc/CCSingleThreadProxy.h:
(CCSingleThreadProxy):
* platform/graphics/chromium/cc/CCSolidColorLayerImpl.h:
* platform/graphics/chromium/cc/CCThreadProxy.cpp:
(WebCore::CCThreadProxy::CCThreadProxy):
(WebCore::CCThreadProxy::compositeAndReadback):
(WebCore::CCThreadProxy::initializeRenderer):
(WebCore::CCThreadProxy::recreateContext):
(WebCore::CCThreadProxy::rendererCapabilities):
(WebCore::CCThreadProxy::forceSerializeOnSwapBuffersOnImplThread):
(WebCore::CCThreadProxy::beginFrame):
(WebCore::CCThreadProxy::beginFrameCompleteOnImplThread):
(WebCore::CCThreadProxy::scheduledActionDrawAndSwapInternal):
(WebCore::CCThreadProxy::initializeRendererOnImplThread):
(WebCore::CCThreadProxy::recreateContextOnImplThread):
* platform/graphics/chromium/cc/CCThreadProxy.h:
(CCThreadProxy):

Source/WebKit/chromium:

* WebKit.gypi:
* tests/CCLayerTreeHostImplTest.cpp:
* tests/CCLayerTreeHostTest.cpp:
(WTF::CCLayerTreeHostTestLayerOcclusion::beginTest):
(WTF::CCLayerTreeHostTestLayerOcclusionWithFilters::beginTest):
(WTF::CCLayerTreeHostTestManySurfaces::beginTest):
(WTF::CCLayerTreeHostTestSurfaceNotAllocatedForLayersOutsideMemoryLimit::drawLayersOnCCThread):
* tests/CCRendererGLTest.cpp: Renamed from Source/WebKit/chromium/tests/LayerRendererChromiumTest.cpp.
(FrameCountingMemoryAllocationSettingContext):
(FrameCountingMemoryAllocationSettingContext::FrameCountingMemoryAllocationSettingContext):
(FrameCountingMemoryAllocationSettingContext::prepareTexture):
(FrameCountingMemoryAllocationSettingContext::setMemoryAllocationChangedCallbackCHROMIUM):
(FrameCountingMemoryAllocationSettingContext::getString):
(FrameCountingMemoryAllocationSettingContext::frameCount):
(FrameCountingMemoryAllocationSettingContext::setMemoryAllocation):
(FakeCCRendererClient):
(FakeCCRendererClient::FakeCCRendererClient):
(FakeCCRendererClient::setFullRootLayerDamageCount):
(FakeCCRendererClient::rootRenderPass):
(FakeCCRendererClient::renderPassesInDrawOrder):
(FakeCCRendererClient::renderPasses):
(FakeCCRendererClient::memoryAllocationLimitBytes):
(FakeCCRendererGL):
(FakeCCRendererGL::FakeCCRendererGL):
(CCRendererGLTest):
(CCRendererGLTest::CCRendererGLTest):
(CCRendererGLTest::SetUp):
(CCRendererGLTest::TearDown):
(CCRendererGLTest::swapBuffers):
(CCRendererGLTest::context):
(TEST_F):
(ForbidSynchronousCallContext):
(ForbidSynchronousCallContext::ForbidSynchronousCallContext):
(ForbidSynchronousCallContext::getActiveAttrib):
(ForbidSynchronousCallContext::getActiveUniform):
(ForbidSynchronousCallContext::getAttachedShaders):
(ForbidSynchronousCallContext::getAttribLocation):
(ForbidSynchronousCallContext::getBooleanv):
(ForbidSynchronousCallContext::getBufferParameteriv):
(ForbidSynchronousCallContext::getContextAttributes):
(ForbidSynchronousCallContext::getError):
(ForbidSynchronousCallContext::getFloatv):
(ForbidSynchronousCallContext::getFramebufferAttachmentParameteriv):
(ForbidSynchronousCallContext::getIntegerv):
(ForbidSynchronousCallContext::getProgramiv):
(ForbidSynchronousCallContext::getShaderiv):
(ForbidSynchronousCallContext::getString):
(ForbidSynchronousCallContext::getProgramInfoLog):
(ForbidSynchronousCallContext::getRenderbufferParameteriv):
(ForbidSynchronousCallContext::getShaderInfoLog):
(ForbidSynchronousCallContext::getShaderPrecisionFormat):
(ForbidSynchronousCallContext::getShaderSource):
(ForbidSynchronousCallContext::getTexParameterfv):
(ForbidSynchronousCallContext::getTexParameteriv):
(ForbidSynchronousCallContext::getUniformfv):
(ForbidSynchronousCallContext::getUniformiv):
(ForbidSynchronousCallContext::getUniformLocation):
(ForbidSynchronousCallContext::getVertexAttribfv):
(ForbidSynchronousCallContext::getVertexAttribiv):
(ForbidSynchronousCallContext::getVertexAttribOffset):
(TEST):
(LoseContextOnFirstGetContext):
(LoseContextOnFirstGetContext::LoseContextOnFirstGetContext):
(ContextThatDoesNotSupportMemoryManagmentExtensions):
(ContextThatDoesNotSupportMemoryManagmentExtensions::ContextThatDoesNotSupportMemoryManagmentExtensions):
(ContextThatDoesNotSupportMemoryManagmentExtensions::prepareTexture):
(ContextThatDoesNotSupportMemoryManagmentExtensions::setMemoryAllocationChangedCallbackCHROMIUM):
(ContextThatDoesNotSupportMemoryManagmentExtensions::getString):
(ClearCountingContext):
(ClearCountingContext::ClearCountingContext):
(ClearCountingContext::clear):
(ClearCountingContext::clearCount):
* tests/TiledLayerChromiumTest.cpp:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@126473 268f45cc-cd09-0410-ab3c-d52691b4dbfc

41 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.gypi
Source/WebCore/platform/graphics/chromium/Canvas2DLayerBridge.cpp
Source/WebCore/platform/graphics/chromium/ContentLayerChromium.cpp
Source/WebCore/platform/graphics/chromium/GeometryBinding.cpp
Source/WebCore/platform/graphics/chromium/HeadsUpDisplayLayerChromium.cpp
Source/WebCore/platform/graphics/chromium/ImageLayerChromium.cpp
Source/WebCore/platform/graphics/chromium/LayerTextureSubImage.cpp
Source/WebCore/platform/graphics/chromium/ProgramBinding.cpp
Source/WebCore/platform/graphics/chromium/RenderSurfaceChromium.h
Source/WebCore/platform/graphics/chromium/ScrollbarLayerChromium.cpp
Source/WebCore/platform/graphics/chromium/TextureCopier.cpp
Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp
Source/WebCore/platform/graphics/chromium/cc/CCHeadsUpDisplayLayerImpl.cpp
Source/WebCore/platform/graphics/chromium/cc/CCIOSurfaceLayerImpl.cpp
Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.cpp
Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp
Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h
Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp
Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.h
Source/WebCore/platform/graphics/chromium/cc/CCPrioritizedTexture.cpp
Source/WebCore/platform/graphics/chromium/cc/CCPrioritizedTextureManager.cpp
Source/WebCore/platform/graphics/chromium/cc/CCPriorityCalculator.cpp
Source/WebCore/platform/graphics/chromium/cc/CCProxy.h
Source/WebCore/platform/graphics/chromium/cc/CCRenderSurface.cpp
Source/WebCore/platform/graphics/chromium/cc/CCRenderSurface.h
Source/WebCore/platform/graphics/chromium/cc/CCRenderer.h
Source/WebCore/platform/graphics/chromium/cc/CCRendererGL.cpp [moved from Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp with 87% similarity]
Source/WebCore/platform/graphics/chromium/cc/CCRendererGL.h [moved from Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h with 91% similarity]
Source/WebCore/platform/graphics/chromium/cc/CCResourceProvider.cpp
Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp
Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.h
Source/WebCore/platform/graphics/chromium/cc/CCSolidColorLayerImpl.h
Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp
Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/WebKit.gypi
Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp
Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp
Source/WebKit/chromium/tests/CCRendererGLTest.cpp [moved from Source/WebKit/chromium/tests/LayerRendererChromiumTest.cpp with 77% similarity]
Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp

index 3a9acb8..43f7f66 100644 (file)
@@ -1,3 +1,191 @@
+2012-08-23  Alexandre Elias  <aelias@chromium.org>
+
+        [chromium] Rename LayerRendererChromium to GL-specific name
+        https://bugs.webkit.org/show_bug.cgi?id=94835
+
+        Reviewed by James Robinson.
+
+        Over time, LayerRendererChromium has evolved to be a GL-specific
+        subclass of CCRenderer that has no awareness of layers (as it operates
+        only with drawQuads).
+
+        This patch renames LayerRendererChromium to CCRendererGL, replaces all
+        instances of "layerRenderer" with just "renderer", and removes a
+        few unnecessary includes of LayerRendererChromium.h.
+
+        No new tests (no-op refactoring).
+
+        * WebCore.gypi:
+        * platform/graphics/chromium/Canvas2DLayerBridge.cpp:
+        * platform/graphics/chromium/ContentLayerChromium.cpp:
+        (WebCore::ContentLayerChromium::createTextureUpdaterIfNeeded):
+        * platform/graphics/chromium/GeometryBinding.cpp:
+        * platform/graphics/chromium/HeadsUpDisplayLayerChromium.cpp:
+        (WebCore::HeadsUpDisplayLayerChromium::update):
+        * platform/graphics/chromium/ImageLayerChromium.cpp:
+        (WebCore::ImageLayerChromium::createTextureUpdaterIfNeeded):
+        * platform/graphics/chromium/LayerTextureSubImage.cpp:
+        * platform/graphics/chromium/ProgramBinding.cpp:
+        * platform/graphics/chromium/RenderSurfaceChromium.h:
+        (WebCore):
+        * platform/graphics/chromium/ScrollbarLayerChromium.cpp:
+        (WebCore::ScrollbarLayerChromium::createTextureUpdaterIfNeeded):
+        * platform/graphics/chromium/TextureCopier.cpp:
+        * platform/graphics/chromium/TiledLayerChromium.cpp:
+        (WebCore::TiledLayerChromium::updateTileSizeAndTilingOption):
+        * platform/graphics/chromium/cc/CCHeadsUpDisplayLayerImpl.cpp:
+        * platform/graphics/chromium/cc/CCIOSurfaceLayerImpl.cpp:
+        * platform/graphics/chromium/cc/CCLayerImpl.cpp:
+        (WebCore::sortLayers):
+        * platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
+        (WebCore::CCLayerTreeHost::CCLayerTreeHost):
+        (WebCore::CCLayerTreeHost::initializeRenderer):
+        (WebCore::CCLayerTreeHost::deleteContentsTexturesOnImplThread):
+        (WebCore::CCLayerTreeHost::finishAllRendering):
+        (WebCore::CCLayerTreeHost::rendererCapabilities):
+        (WebCore::CCLayerTreeHost::initializeRendererIfNeeded):
+        (WebCore::CCLayerTreeHost::updateLayers):
+        * platform/graphics/chromium/cc/CCLayerTreeHost.h:
+        (WebCore::RendererCapabilities::RendererCapabilities):
+        (CCLayerTreeHost):
+        * platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
+        (WebCore::CCLayerTreeHostImpl::canDraw):
+        (WebCore::CCLayerTreeHostImpl::calculateRenderSurfaceLayerList):
+        (WebCore::CCLayerTreeHostImpl::calculateRenderPasses):
+        (WebCore::CCLayerTreeHostImpl::drawLayers):
+        (WebCore::CCLayerTreeHostImpl::finishAllRendering):
+        (WebCore::CCLayerTreeHostImpl::isContextLost):
+        (WebCore::CCLayerTreeHostImpl::rendererCapabilities):
+        (WebCore::CCLayerTreeHostImpl::swapBuffers):
+        (WebCore::CCLayerTreeHostImpl::readback):
+        (WebCore::CCLayerTreeHostImpl::setVisible):
+        (WebCore::CCLayerTreeHostImpl::initializeRenderer):
+        (WebCore::CCLayerTreeHostImpl::setViewportSize):
+        (WebCore::CCLayerTreeHostImpl::ensureRenderSurfaceLayerList):
+        * platform/graphics/chromium/cc/CCLayerTreeHostImpl.h:
+        (WebCore):
+        (WebCore::CCLayerTreeHostImpl::renderer):
+        (CCLayerTreeHostImpl):
+        * platform/graphics/chromium/cc/CCPrioritizedTexture.cpp:
+        * platform/graphics/chromium/cc/CCPrioritizedTextureManager.cpp:
+        * platform/graphics/chromium/cc/CCPriorityCalculator.cpp:
+        * platform/graphics/chromium/cc/CCProxy.h:
+        (WebCore):
+        (CCProxy):
+        * platform/graphics/chromium/cc/CCRenderSurface.cpp:
+        * platform/graphics/chromium/cc/CCRenderSurface.h:
+        (WebCore):
+        * platform/graphics/chromium/cc/CCRenderer.h:
+        (CCRenderer):
+        * platform/graphics/chromium/cc/CCRendererGL.cpp: Renamed from Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp.
+        (WebCore::CCRendererGL::create):
+        (WebCore):
+        (WebCore::CCRendererGL::CCRendererGL):
+        (WebCore::CCRendererGL::initialize):
+        (WebCore::CCRendererGL::~CCRendererGL):
+        (WebCore::CCRendererGL::context):
+        (WebCore::CCRendererGL::debugGLCall):
+        (WebCore::CCRendererGL::setVisible):
+        (WebCore::CCRendererGL::releaseRenderPassTextures):
+        (WebCore::CCRendererGL::viewportChanged):
+        (WebCore::CCRendererGL::clearFramebuffer):
+        (WebCore::CCRendererGL::beginDrawingFrame):
+        (WebCore::CCRendererGL::doNoOp):
+        (WebCore::CCRendererGL::drawQuad):
+        (WebCore::CCRendererGL::drawCheckerboardQuad):
+        (WebCore::CCRendererGL::drawDebugBorderQuad):
+        (WebCore::applyFilters):
+        (WebCore::CCRendererGL::drawBackgroundFilters):
+        (WebCore::CCRendererGL::drawRenderPassQuad):
+        (WebCore::CCRendererGL::drawSolidColorQuad):
+        (TileProgramUniforms):
+        (WebCore::tileUniformLocation):
+        (WebCore::CCRendererGL::drawTileQuad):
+        (WebCore::CCRendererGL::drawYUVVideoQuad):
+        (WebCore::CCRendererGL::drawStreamVideoQuad):
+        (WebCore::TextureProgramBinding::set):
+        (TextureProgramBinding):
+        (WebCore::TexTransformTextureProgramBinding::set):
+        (TexTransformTextureProgramBinding):
+        (WebCore::CCRendererGL::drawTextureQuad):
+        (WebCore::CCRendererGL::drawIOSurfaceQuad):
+        (WebCore::CCRendererGL::finishDrawingFrame):
+        (WebCore::CCRendererGL::toGLMatrix):
+        (WebCore::CCRendererGL::setShaderFloatQuad):
+        (WebCore::CCRendererGL::setShaderOpacity):
+        (WebCore::CCRendererGL::drawQuadGeometry):
+        (WebCore::CCRendererGL::copyTextureToFramebuffer):
+        (WebCore::CCRendererGL::finish):
+        (WebCore::CCRendererGL::swapBuffers):
+        (WebCore::CCRendererGL::onSwapBuffersComplete):
+        (WebCore::CCRendererGL::onMemoryAllocationChanged):
+        (WebCore::CCRendererGL::onMemoryAllocationChangedOnImplThread):
+        (WebCore::CCRendererGL::discardFramebuffer):
+        (WebCore::CCRendererGL::ensureFramebuffer):
+        (WebCore::CCRendererGL::onContextLost):
+        (WebCore::CCRendererGL::getFramebufferPixels):
+        (WebCore::CCRendererGL::getFramebufferTexture):
+        (WebCore::CCRendererGL::useScopedTexture):
+        (WebCore::CCRendererGL::bindFramebufferToOutputSurface):
+        (WebCore::CCRendererGL::bindFramebufferToTexture):
+        (WebCore::CCRendererGL::enableScissorTestRect):
+        (WebCore::CCRendererGL::disableScissorTest):
+        (WebCore::CCRendererGL::setDrawViewportSize):
+        (WebCore::CCRendererGL::makeContextCurrent):
+        (WebCore::CCRendererGL::initializeSharedObjects):
+        (WebCore::CCRendererGL::tileCheckerboardProgram):
+        (WebCore::CCRendererGL::solidColorProgram):
+        (WebCore::CCRendererGL::renderPassProgram):
+        (WebCore::CCRendererGL::renderPassProgramAA):
+        (WebCore::CCRendererGL::renderPassMaskProgram):
+        (WebCore::CCRendererGL::renderPassMaskProgramAA):
+        (WebCore::CCRendererGL::tileProgram):
+        (WebCore::CCRendererGL::tileProgramOpaque):
+        (WebCore::CCRendererGL::tileProgramAA):
+        (WebCore::CCRendererGL::tileProgramSwizzle):
+        (WebCore::CCRendererGL::tileProgramSwizzleOpaque):
+        (WebCore::CCRendererGL::tileProgramSwizzleAA):
+        (WebCore::CCRendererGL::textureProgram):
+        (WebCore::CCRendererGL::textureProgramFlip):
+        (WebCore::CCRendererGL::textureIOSurfaceProgram):
+        (WebCore::CCRendererGL::videoYUVProgram):
+        (WebCore::CCRendererGL::videoStreamTextureProgram):
+        (WebCore::CCRendererGL::cleanupSharedObjects):
+        (WebCore::CCRendererGL::isContextLost):
+        * platform/graphics/chromium/cc/CCRendererGL.h: Renamed from Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h.
+        (WebKit):
+        (WebCore):
+        (CCRendererGL):
+        (WebCore::CCRendererGL::sharedGeometryQuad):
+        (WebCore::CCRendererGL::sharedGeometry):
+        (WebCore::CCRendererGL::isFramebufferDiscarded):
+        * platform/graphics/chromium/cc/CCResourceProvider.cpp:
+        * platform/graphics/chromium/cc/CCSingleThreadProxy.cpp:
+        (WebCore::CCSingleThreadProxy::CCSingleThreadProxy):
+        (WebCore::CCSingleThreadProxy::initializeRenderer):
+        (WebCore::CCSingleThreadProxy::recreateContext):
+        (WebCore::CCSingleThreadProxy::rendererCapabilities):
+        (WebCore::CCSingleThreadProxy::doCommit):
+        (WebCore::CCSingleThreadProxy::forceSerializeOnSwapBuffers):
+        (WebCore::CCSingleThreadProxy::commitAndComposite):
+        * platform/graphics/chromium/cc/CCSingleThreadProxy.h:
+        (CCSingleThreadProxy):
+        * platform/graphics/chromium/cc/CCSolidColorLayerImpl.h:
+        * platform/graphics/chromium/cc/CCThreadProxy.cpp:
+        (WebCore::CCThreadProxy::CCThreadProxy):
+        (WebCore::CCThreadProxy::compositeAndReadback):
+        (WebCore::CCThreadProxy::initializeRenderer):
+        (WebCore::CCThreadProxy::recreateContext):
+        (WebCore::CCThreadProxy::rendererCapabilities):
+        (WebCore::CCThreadProxy::forceSerializeOnSwapBuffersOnImplThread):
+        (WebCore::CCThreadProxy::beginFrame):
+        (WebCore::CCThreadProxy::beginFrameCompleteOnImplThread):
+        (WebCore::CCThreadProxy::scheduledActionDrawAndSwapInternal):
+        (WebCore::CCThreadProxy::initializeRendererOnImplThread):
+        (WebCore::CCThreadProxy::recreateContextOnImplThread):
+        * platform/graphics/chromium/cc/CCThreadProxy.h:
+        (CCThreadProxy):
+
 2012-08-23  Shezan Baig  <shezbaig.wk@gmail.com>
 
         Flexbox doesn't need to compute logical height for stretched items in row flow
index 0e954d7..2c92e56 100644 (file)
             'platform/graphics/chromium/LayerChromium.cpp',
             'platform/graphics/chromium/LayerChromium.h',
             'platform/graphics/chromium/LayerPainterChromium.h',
-            'platform/graphics/chromium/LayerRendererChromium.cpp',
-            'platform/graphics/chromium/LayerRendererChromium.h',
             'platform/graphics/chromium/LayerTextureSubImage.cpp',
             'platform/graphics/chromium/LayerTextureSubImage.h',
             'platform/graphics/chromium/LayerTextureUpdater.h',
             'platform/graphics/chromium/cc/CCQuadCuller.cpp',
             'platform/graphics/chromium/cc/CCQuadCuller.h',
             'platform/graphics/chromium/cc/CCRenderer.h',
+            'platform/graphics/chromium/cc/CCRendererGL.cpp',
+            'platform/graphics/chromium/cc/CCRendererGL.h',
             'platform/graphics/chromium/cc/CCRenderPass.cpp',
             'platform/graphics/chromium/cc/CCRenderPass.h',
             'platform/graphics/chromium/cc/CCRenderPassDrawQuad.cpp',
index 1065431..ed332b1 100644 (file)
 
 #include "Canvas2DLayerBridge.h"
 
+#include "CCRendererGL.h" // For the GLC() macro.
 #include "GrContext.h"
 #include "GraphicsContext3D.h"
 #include "GraphicsContext3DPrivate.h"
-#include "LayerRendererChromium.h" // For GLC() macro.
 #include "TraceEvent.h"
 #include <public/WebCompositor.h>
 #include <public/WebGraphicsContext3D.h>
@@ -166,4 +166,3 @@ unsigned Canvas2DLayerBridge::backBufferTexture()
 }
 
 }
-
index a8f57e2..c2bf45e 100644 (file)
@@ -117,7 +117,7 @@ void ContentLayerChromium::createTextureUpdaterIfNeeded()
         m_textureUpdater = BitmapCanvasLayerTextureUpdater::create(ContentLayerPainter::create(m_delegate));
     m_textureUpdater->setOpaque(opaque());
 
-    GC3Denum textureFormat = layerTreeHost()->layerRendererCapabilities().bestTextureFormat;
+    GC3Denum textureFormat = layerTreeHost()->rendererCapabilities().bestTextureFormat;
     setTextureFormat(textureFormat);
     setSampledTexelFormat(textureUpdater()->sampledTexelFormat(textureFormat));
 }
index 67ab462..960ef95 100644 (file)
@@ -29,8 +29,8 @@
 
 #include "GeometryBinding.h"
 
+#include "CCRendererGL.h" // For the GLC() macro.
 #include "GraphicsContext3D.h"
-#include "LayerRendererChromium.h"
 #include <public/WebGraphicsContext3D.h>
 
 namespace WebCore {
index 2ae58ab..dc71d27 100644 (file)
@@ -52,7 +52,7 @@ HeadsUpDisplayLayerChromium::~HeadsUpDisplayLayerChromium()
 void HeadsUpDisplayLayerChromium::update(CCTextureUpdateQueue&, const CCOcclusionTracker*, CCRenderingStats&)
 {
     const CCLayerTreeSettings& settings = layerTreeHost()->settings();
-    int maxTextureSize = layerTreeHost()->layerRendererCapabilities().maxTextureSize;
+    int maxTextureSize = layerTreeHost()->rendererCapabilities().maxTextureSize;
 
     IntSize bounds;
     if (settings.showPlatformLayerTree || settings.showDebugRects()) {
index f8d869f..1049e03 100644 (file)
@@ -157,7 +157,7 @@ void ImageLayerChromium::createTextureUpdaterIfNeeded()
         return;
 
     m_textureUpdater = ImageLayerTextureUpdater::create();
-    GC3Denum textureFormat = layerTreeHost()->layerRendererCapabilities().bestTextureFormat;
+    GC3Denum textureFormat = layerTreeHost()->rendererCapabilities().bestTextureFormat;
     setTextureFormat(textureFormat);
     setSampledTexelFormat(textureUpdater()->sampledTexelFormat(textureFormat));
 }
index 83c7114..5c8960e 100644 (file)
@@ -29,8 +29,8 @@
 
 #include "LayerTextureSubImage.h"
 
+#include "CCRendererGL.h" // For the GLC() macro.
 #include "Extensions3DChromium.h"
-#include "LayerRendererChromium.h" // For GLC() macro
 #include "TraceEvent.h"
 #include <public/WebGraphicsContext3D.h>
 
index 2f6ca22..ccc1487 100644 (file)
@@ -29,9 +29,9 @@
 
 #include "ProgramBinding.h"
 
+#include "CCRendererGL.h" // For the GLC() macro.
 #include "GeometryBinding.h"
 #include "GraphicsContext3D.h"
-#include "LayerRendererChromium.h"
 #include "TraceEvent.h"
 #include <public/WebGraphicsContext3D.h>
 #include <wtf/text/CString.h>
index 7b11f6a..787eaae 100644 (file)
@@ -37,7 +37,6 @@
 namespace WebCore {
 
 class LayerChromium;
-class LayerRendererChromium;
 
 class RenderSurfaceChromium {
     WTF_MAKE_NONCOPYABLE(RenderSurfaceChromium);
index 67fbd36..5dd1045 100644 (file)
@@ -188,7 +188,7 @@ void ScrollbarLayerChromium::setLayerTreeHost(CCLayerTreeHost* host)
 
 void ScrollbarLayerChromium::createTextureUpdaterIfNeeded()
 {
-    m_textureFormat = layerTreeHost()->layerRendererCapabilities().bestTextureFormat;
+    m_textureFormat = layerTreeHost()->rendererCapabilities().bestTextureFormat;
 
     if (!m_backTrackUpdater)
         m_backTrackUpdater = BitmapCanvasLayerTextureUpdater::create(ScrollbarBackgroundPainter::create(m_scrollbar.get(), m_painter, m_geometry.get(), WebKit::WebScrollbar::BackTrackPart));
index fbb7cff..e20c323 100644 (file)
@@ -26,8 +26,8 @@
 
 #include "TextureCopier.h"
 
+#include "CCRendererGL.h" // For the GLC() macro.
 #include "GraphicsContext3D.h"
-#include "LayerRendererChromium.h" // For the GLC() macro
 #include "TraceEvent.h"
 #include <public/WebGraphicsContext3D.h>
 
index 68bfa45..5dc65ec 100644 (file)
@@ -149,7 +149,7 @@ void TiledLayerChromium::updateTileSizeAndTilingOption()
         isTiled = autoTiled;
 
     IntSize requestedSize = isTiled ? tileSize : contentBounds();
-    const int maxSize = layerTreeHost()->layerRendererCapabilities().maxTextureSize;
+    const int maxSize = layerTreeHost()->rendererCapabilities().maxTextureSize;
     IntSize clampedSize = requestedSize.shrunkTo(IntSize(maxSize, maxSize));
     setTileSize(clampedSize);
 }
index 5fdd2cd..3708105 100644 (file)
@@ -35,7 +35,6 @@
 #include "CCTextureDrawQuad.h"
 #include "Extensions3DChromium.h"
 #include "GraphicsContext3D.h"
-#include "LayerRendererChromium.h"
 #include "SkBitmap.h"
 #include "SkColorMatrixFilter.h"
 #include "SkPaint.h"
index 283b7c9..ab7e085 100644 (file)
@@ -33,8 +33,8 @@
 #include "CCIOSurfaceDrawQuad.h"
 #include "CCLayerTreeHostImpl.h"
 #include "CCQuadSink.h"
+#include "CCRendererGL.h" // For the GLC() macro.
 #include "Extensions3D.h"
-#include "LayerRendererChromium.h"
 #include "TextStream.h"
 #include <public/WebGraphicsContext3D.h>
 
index 8444d1d..98b2160 100644 (file)
@@ -263,7 +263,7 @@ void CCLayerImpl::dumpLayerProperties(TextStream& ts, int indent) const
 
 void sortLayers(Vector<CCLayerImpl*>::iterator first, Vector<CCLayerImpl*>::iterator end, CCLayerSorter* layerSorter)
 {
-    TRACE_EVENT0("cc", "LayerRendererChromium::sortLayers");
+    TRACE_EVENT0("cc", "CCLayerImpl::sortLayers");
     layerSorter->sort(first, end);
 }
 
index 2e3a7de..5ee1bf6 100644 (file)
@@ -75,7 +75,7 @@ CCLayerTreeHost::CCLayerTreeHost(CCLayerTreeHostClient* client, const CCLayerTre
     , m_client(client)
     , m_commitNumber(0)
     , m_renderingStats()
-    , m_layerRendererInitialized(false)
+    , m_rendererInitialized(false)
     , m_contextLost(false)
     , m_numTimesRecreateShouldFail(0)
     , m_numFailedRecreateAttempts(0)
@@ -131,30 +131,30 @@ void CCLayerTreeHost::setSurfaceReady()
     m_proxy->setSurfaceReady();
 }
 
-void CCLayerTreeHost::initializeLayerRenderer()
+void CCLayerTreeHost::initializeRenderer()
 {
-    TRACE_EVENT0("cc", "CCLayerTreeHost::initializeLayerRenderer");
-    if (!m_proxy->initializeLayerRenderer()) {
+    TRACE_EVENT0("cc", "CCLayerTreeHost::initializeRenderer");
+    if (!m_proxy->initializeRenderer()) {
         // Uh oh, better tell the client that we can't do anything with this context.
         m_client->didRecreateOutputSurface(false);
         return;
     }
 
     // Update m_settings based on capabilities that we got back from the renderer.
-    m_settings.acceleratePainting = m_proxy->layerRendererCapabilities().usingAcceleratedPainting;
+    m_settings.acceleratePainting = m_proxy->rendererCapabilities().usingAcceleratedPainting;
 
     // Update m_settings based on partial update capability.
     m_settings.maxPartialTextureUpdates = min(m_settings.maxPartialTextureUpdates, m_proxy->maxPartialTextureUpdates());
 
-    m_contentsTextureManager = CCPrioritizedTextureManager::create(0, m_proxy->layerRendererCapabilities().maxTextureSize, CCRenderer::ContentPool);
+    m_contentsTextureManager = CCPrioritizedTextureManager::create(0, m_proxy->rendererCapabilities().maxTextureSize, CCRenderer::ContentPool);
     m_surfaceMemoryPlaceholder = m_contentsTextureManager->createTexture(IntSize(), GraphicsContext3D::RGBA);
 
-    m_layerRendererInitialized = true;
+    m_rendererInitialized = true;
 
-    m_settings.defaultTileSize = IntSize(min(m_settings.defaultTileSize.width(), m_proxy->layerRendererCapabilities().maxTextureSize),
-                                         min(m_settings.defaultTileSize.height(), m_proxy->layerRendererCapabilities().maxTextureSize));
-    m_settings.maxUntiledLayerSize = IntSize(min(m_settings.maxUntiledLayerSize.width(), m_proxy->layerRendererCapabilities().maxTextureSize),
-                                             min(m_settings.maxUntiledLayerSize.height(), m_proxy->layerRendererCapabilities().maxTextureSize));
+    m_settings.defaultTileSize = IntSize(min(m_settings.defaultTileSize.width(), m_proxy->rendererCapabilities().maxTextureSize),
+                                         min(m_settings.defaultTileSize.height(), m_proxy->rendererCapabilities().maxTextureSize));
+    m_settings.maxUntiledLayerSize = IntSize(min(m_settings.maxUntiledLayerSize.width(), m_proxy->rendererCapabilities().maxTextureSize),
+                                             min(m_settings.maxUntiledLayerSize.height(), m_proxy->rendererCapabilities().maxTextureSize));
 }
 
 CCLayerTreeHost::RecreateResult CCLayerTreeHost::recreateContext()
@@ -195,7 +195,7 @@ CCLayerTreeHost::RecreateResult CCLayerTreeHost::recreateContext()
 void CCLayerTreeHost::deleteContentsTexturesOnImplThread(CCResourceProvider* resourceProvider)
 {
     ASSERT(CCProxy::isImplThread());
-    if (m_layerRendererInitialized)
+    if (m_rendererInitialized)
         m_contentsTextureManager->clearAllMemory(resourceProvider);
 }
 
@@ -317,7 +317,7 @@ bool CCLayerTreeHost::compositeAndReadback(void *pixels, const IntRect& rect)
 
 void CCLayerTreeHost::finishAllRendering()
 {
-    if (!m_layerRendererInitialized)
+    if (!m_rendererInitialized)
         return;
     m_proxy->finishAllRendering();
 }
@@ -328,9 +328,9 @@ void CCLayerTreeHost::renderingStats(CCRenderingStats& stats) const
     m_proxy->implSideRenderingStats(stats);
 }
 
-const LayerRendererCapabilities& CCLayerTreeHost::layerRendererCapabilities() const
+const RendererCapabilities& CCLayerTreeHost::rendererCapabilities() const
 {
-    return m_proxy->layerRendererCapabilities();
+    return m_proxy->rendererCapabilities();
 }
 
 void CCLayerTreeHost::setNeedsAnimate()
@@ -446,12 +446,12 @@ void CCLayerTreeHost::scheduleComposite()
     m_client->scheduleComposite();
 }
 
-bool CCLayerTreeHost::initializeLayerRendererIfNeeded()
+bool CCLayerTreeHost::initializeRendererIfNeeded()
 {
-    if (!m_layerRendererInitialized) {
-        initializeLayerRenderer();
+    if (!m_rendererInitialized) {
+        initializeRenderer();
         // If we couldn't initialize, then bail since we're returning to software mode.
-        if (!m_layerRendererInitialized)
+        if (!m_rendererInitialized)
             return false;
     }
     if (m_contextLost) {
@@ -464,7 +464,7 @@ bool CCLayerTreeHost::initializeLayerRendererIfNeeded()
 
 void CCLayerTreeHost::updateLayers(CCTextureUpdateQueue& queue, size_t memoryAllocationLimitBytes)
 {
-    ASSERT(m_layerRendererInitialized);
+    ASSERT(m_rendererInitialized);
     ASSERT(memoryAllocationLimitBytes);
 
     if (!rootLayer())
@@ -486,7 +486,7 @@ void CCLayerTreeHost::updateLayers(LayerChromium* rootLayer, CCTextureUpdateQueu
 
     {
         TRACE_EVENT0("cc", "CCLayerTreeHost::updateLayers::calcDrawEtc");
-        CCLayerTreeHostCommon::calculateDrawTransforms(rootLayer, deviceViewportSize(), m_deviceScaleFactor, layerRendererCapabilities().maxTextureSize, updateList);
+        CCLayerTreeHostCommon::calculateDrawTransforms(rootLayer, deviceViewportSize(), m_deviceScaleFactor, rendererCapabilities().maxTextureSize, updateList);
         CCLayerTreeHostCommon::calculateVisibleRects(updateList);
     }
 
index baee9e5..cc0b45d 100644 (file)
@@ -115,8 +115,8 @@ struct CCLayerTreeSettings {
 };
 
 // Provides information on an Impl's rendering capabilities back to the CCLayerTreeHost
-struct LayerRendererCapabilities {
-    LayerRendererCapabilities()
+struct RendererCapabilities {
+    RendererCapabilities()
         : bestTextureFormat(0)
         , contextHasCachedFrontBuffer(false)
         , usingPartialSwap(false)
@@ -178,7 +178,7 @@ public:
     void deleteContentsTexturesOnImplThread(CCResourceProvider*);
     virtual void acquireLayerTextures();
     // Returns false if we should abort this frame due to initialization failure.
-    bool initializeLayerRendererIfNeeded();
+    bool initializeRendererIfNeeded();
     void updateLayers(CCTextureUpdateQueue&, size_t contentsMemoryLimitBytes);
 
     CCLayerTreeHostClient* client() { return m_client; }
@@ -200,7 +200,7 @@ public:
 
     void renderingStats(CCRenderingStats&) const;
 
-    const LayerRendererCapabilities& layerRendererCapabilities() const;
+    const RendererCapabilities& rendererCapabilities() const;
 
     // Test only hook
     void loseContext(int numTimes);
@@ -269,7 +269,7 @@ private:
     typedef Vector<RefPtr<LayerChromium> > LayerList;
     typedef Vector<OwnPtr<CCPrioritizedTexture> > TextureList;
 
-    void initializeLayerRenderer();
+    void initializeRenderer();
 
     void update(LayerChromium*, CCTextureUpdateQueue&, const CCOcclusionTracker*);
     bool paintLayerContents(const LayerList&, CCTextureUpdateQueue&);
@@ -297,7 +297,7 @@ private:
     CCRenderingStats m_renderingStats;
 
     OwnPtr<CCProxy> m_proxy;
-    bool m_layerRendererInitialized;
+    bool m_rendererInitialized;
     bool m_contextLost;
     int m_numTimesRecreateShouldFail;
     int m_numFailedRecreateAttempts;
index 46edcc0..1d42c8e 100644 (file)
 #include "CCPageScaleAnimation.h"
 #include "CCPrioritizedTextureManager.h"
 #include "CCRenderPassDrawQuad.h"
+#include "CCRendererGL.h"
 #include "CCRenderingStats.h"
 #include "CCScrollbarAnimationController.h"
 #include "CCScrollbarLayerImpl.h"
 #include "CCSettings.h"
 #include "CCSingleThreadProxy.h"
-#include "LayerRendererChromium.h"
 #include "TextStream.h"
 #include "TraceEvent.h"
 #include <wtf/CurrentTime.h>
@@ -175,8 +175,8 @@ bool CCLayerTreeHostImpl::canDraw()
         TRACE_EVENT_INSTANT0("cc", "CCLayerTreeHostImpl::canDraw empty viewport");
         return false;
     }
-    if (!m_layerRenderer) {
-        TRACE_EVENT_INSTANT0("cc", "CCLayerTreeHostImpl::canDraw no layerRenderer");
+    if (!m_renderer) {
+        TRACE_EVENT_INSTANT0("cc", "CCLayerTreeHostImpl::canDraw no renderer");
         return false;
     }
     if (m_contentsTexturesPurged) {
@@ -255,11 +255,11 @@ void CCLayerTreeHostImpl::calculateRenderSurfaceLayerList(CCLayerList& renderSur
 {
     ASSERT(renderSurfaceLayerList.isEmpty());
     ASSERT(m_rootLayerImpl);
-    ASSERT(m_layerRenderer); // For maxTextureSize.
+    ASSERT(m_renderer); // For maxTextureSize.
 
     {
         TRACE_EVENT0("cc", "CCLayerTreeHostImpl::calcDrawEtc");
-        CCLayerTreeHostCommon::calculateDrawTransforms(m_rootLayerImpl.get(), deviceViewportSize(), m_deviceScaleFactor, &m_layerSorter, layerRendererCapabilities().maxTextureSize, renderSurfaceLayerList);
+        CCLayerTreeHostCommon::calculateDrawTransforms(m_rootLayerImpl.get(), deviceViewportSize(), m_deviceScaleFactor, &m_layerSorter, rendererCapabilities().maxTextureSize, renderSurfaceLayerList);
         CCLayerTreeHostCommon::calculateVisibleRects(renderSurfaceLayerList);
 
         trackDamageForAllSurfaces(m_rootLayerImpl.get(), renderSurfaceLayerList);
@@ -347,8 +347,8 @@ bool CCLayerTreeHostImpl::calculateRenderPasses(FrameData& frame)
         occlusionTracker.overdrawMetrics().recordMetrics(this);
 
     removeRenderPasses(CullRenderPassesWithNoQuads(), frame);
-    m_layerRenderer->decideRenderPassAllocationsForFrame(frame.renderPasses);
-    removeRenderPasses(CullRenderPassesWithCachedTextures(*m_layerRenderer), frame);
+    m_renderer->decideRenderPassAllocationsForFrame(frame.renderPasses);
+    removeRenderPasses(CullRenderPassesWithCachedTextures(*m_renderer), frame);
 
     return drawFrame;
 }
@@ -557,7 +557,7 @@ void CCLayerTreeHostImpl::drawLayers(const FrameData& frame)
     if (m_hudLayerImpl)
         m_hudLayerImpl->updateHudTexture(m_resourceProvider.get());
 
-    m_layerRenderer->drawFrame(frame.renderPasses, frame.renderPassesById);
+    m_renderer->drawFrame(frame.renderPasses, frame.renderPassesById);
 
     // Once a RenderPass has been drawn, its damage should be cleared in
     // case the RenderPass will be reused next frame.
@@ -578,26 +578,26 @@ void CCLayerTreeHostImpl::didDrawAllLayers(const FrameData& frame)
 
 void CCLayerTreeHostImpl::finishAllRendering()
 {
-    if (m_layerRenderer)
-        m_layerRenderer->finish();
+    if (m_renderer)
+        m_renderer->finish();
 }
 
 bool CCLayerTreeHostImpl::isContextLost()
 {
-    return m_layerRenderer && m_layerRenderer->isContextLost();
+    return m_renderer && m_renderer->isContextLost();
 }
 
-const LayerRendererCapabilities& CCLayerTreeHostImpl::layerRendererCapabilities() const
+const RendererCapabilities& CCLayerTreeHostImpl::rendererCapabilities() const
 {
-    return m_layerRenderer->capabilities();
+    return m_renderer->capabilities();
 }
 
 bool CCLayerTreeHostImpl::swapBuffers()
 {
-    ASSERT(m_layerRenderer);
+    ASSERT(m_renderer);
 
     m_fpsCounter->markEndOfFrame();
-    return m_layerRenderer->swapBuffers();
+    return m_renderer->swapBuffers();
 }
 
 void CCLayerTreeHostImpl::didLoseContext()
@@ -612,8 +612,8 @@ void CCLayerTreeHostImpl::onSwapBuffersComplete()
 
 void CCLayerTreeHostImpl::readback(void* pixels, const IntRect& rect)
 {
-    ASSERT(m_layerRenderer);
-    m_layerRenderer->getFramebufferPixels(pixels, rect);
+    ASSERT(m_renderer);
+    m_renderer->getFramebufferPixels(pixels, rect);
 }
 
 static CCLayerImpl* findRootScrollLayer(CCLayerImpl* layer)
@@ -681,15 +681,15 @@ void CCLayerTreeHostImpl::setVisible(bool visible)
     m_visible = visible;
     didVisibilityChange(this, m_visible);
 
-    if (!m_layerRenderer)
+    if (!m_renderer)
         return;
 
-    m_layerRenderer->setVisible(visible);
+    m_renderer->setVisible(visible);
 
     setBackgroundTickingEnabled(!m_visible && m_needsAnimateLayers);
 }
 
-bool CCLayerTreeHostImpl::initializeLayerRenderer(PassOwnPtr<CCGraphicsContext> context, TextureUploaderOption textureUploader)
+bool CCLayerTreeHostImpl::initializeRenderer(PassOwnPtr<CCGraphicsContext> context, TextureUploaderOption textureUploader)
 {
     if (!context->bindToClient(this))
         return false;
@@ -703,26 +703,26 @@ bool CCLayerTreeHostImpl::initializeLayerRenderer(PassOwnPtr<CCGraphicsContext>
 
     OwnPtr<CCGraphicsContext> contextRef(context);
     OwnPtr<CCResourceProvider> resourceProvider = CCResourceProvider::create(contextRef.get());
-    OwnPtr<LayerRendererChromium> layerRenderer;
+    OwnPtr<CCRendererGL> renderer;
     if (resourceProvider.get())
-        layerRenderer = LayerRendererChromium::create(this, resourceProvider.get(), textureUploader);
+        renderer = CCRendererGL::create(this, resourceProvider.get(), textureUploader);
 
-    // Since we now have a new context/layerRenderer, we cannot continue to use the old
+    // Since we now have a new context/renderer, we cannot continue to use the old
     // resources (i.e. renderSurfaces and texture IDs).
     if (m_rootLayerImpl) {
         clearRenderSurfaces();
         sendDidLoseContextRecursive(m_rootLayerImpl.get());
     }
 
-    m_layerRenderer = layerRenderer.release();
+    m_renderer = renderer.release();
     m_resourceProvider = resourceProvider.release();
-    if (m_layerRenderer)
+    if (m_renderer)
         m_context = contextRef.release();
 
-    if (!m_visible && m_layerRenderer)
-         m_layerRenderer->setVisible(m_visible);
+    if (!m_visible && m_renderer)
+         m_renderer->setVisible(m_visible);
 
-    return m_layerRenderer;
+    return m_renderer;
 }
 
 void CCLayerTreeHostImpl::setViewportSize(const IntSize& layoutViewportSize, const IntSize& deviceViewportSize)
@@ -735,8 +735,8 @@ void CCLayerTreeHostImpl::setViewportSize(const IntSize& layoutViewportSize, con
 
     updateMaxScrollPosition();
 
-    if (m_layerRenderer)
-        m_layerRenderer->viewportChanged();
+    if (m_renderer)
+        m_renderer->viewportChanged();
 }
 
 static void adjustScrollsForPageScaleChange(CCLayerImpl* layerImpl, float pageScaleChange)
@@ -840,7 +840,7 @@ bool CCLayerTreeHostImpl::ensureRenderSurfaceLayerList()
 {
     if (!m_rootLayerImpl)
         return false;
-    if (!m_layerRenderer)
+    if (!m_renderer)
         return false;
 
     // We need both a non-empty render surface layer list and a root render
index 5a4b64a..bfda2b1 100644 (file)
@@ -47,8 +47,7 @@ class CCLayerTreeHostImplTimeSourceAdapter;
 class CCPageScaleAnimation;
 class CCRenderPassDrawQuad;
 class CCResourceProvider;
-class LayerRendererChromium;
-struct LayerRendererCapabilities;
+struct RendererCapabilities;
 struct CCRenderingStats;
 
 // CCLayerTreeHost->CCProxy callback interface.
@@ -129,10 +128,10 @@ public:
     void finishAllRendering();
     int sourceAnimationFrameNumber() const;
 
-    bool initializeLayerRenderer(PassOwnPtr<CCGraphicsContext>, TextureUploaderOption);
+    bool initializeRenderer(PassOwnPtr<CCGraphicsContext>, TextureUploaderOption);
     bool isContextLost();
-    CCRenderer* layerRenderer() { return m_layerRenderer.get(); }
-    const LayerRendererCapabilities& layerRendererCapabilities() const;
+    CCRenderer* renderer() { return m_renderer.get(); }
+    const RendererCapabilities& rendererCapabilities() const;
 
     bool swapBuffers();
 
@@ -267,7 +266,7 @@ private:
 
     OwnPtr<CCGraphicsContext> m_context;
     OwnPtr<CCResourceProvider> m_resourceProvider;
-    OwnPtr<CCRenderer> m_layerRenderer;
+    OwnPtr<CCRenderer> m_renderer;
     OwnPtr<CCLayerImpl> m_rootLayerImpl;
     CCLayerImpl* m_rootScrollLayerImpl;
     CCLayerImpl* m_currentlyScrollingLayerImpl;
index b172276..d9f68af 100644 (file)
@@ -28,7 +28,6 @@
 
 #include "CCPrioritizedTextureManager.h"
 #include "CCPriorityCalculator.h"
-#include "LayerRendererChromium.h"
 #include <algorithm>
 
 using namespace std;
index 4a24179..96fb05d 100644 (file)
@@ -28,7 +28,6 @@
 
 #include "CCPrioritizedTexture.h"
 #include "CCPriorityCalculator.h"
-#include "LayerRendererChromium.h"
 #include "TraceEvent.h"
 #include <algorithm>
 
index 9008404..5a8beba 100644 (file)
@@ -26,8 +26,6 @@
 
 #include "CCPriorityCalculator.h"
 
-#include "LayerRendererChromium.h"
-
 using namespace std;
 
 namespace WebCore {
@@ -92,4 +90,3 @@ int CCPriorityCalculator::priorityFromVisibility(bool visible, bool drawsToRootS
 }
 
 } // WebCore
-
index 935f133..602e9d4 100644 (file)
@@ -36,7 +36,7 @@ namespace WebCore {
 
 class CCThread;
 struct CCRenderingStats;
-struct LayerRendererCapabilities;
+struct RendererCapabilities;
 
 // Abstract class responsible for proxying commands from the main-thread side of
 // the compositor over to the compositor implementation.
@@ -64,7 +64,7 @@ public:
     virtual bool isStarted() const = 0;
 
     // Attempts to initialize a context to use for rendering. Returns false if the context could not be created.
-    // The context will not be used and no frames may be produced until initializeLayerRenderer() is called.
+    // The context will not be used and no frames may be produced until initializeRenderer() is called.
     virtual bool initializeContext() = 0;
 
     // Indicates that the compositing surface associated with our context is ready to use.
@@ -73,7 +73,7 @@ public:
     virtual void setVisible(bool) = 0;
 
     // Attempts to initialize the layer renderer. Returns false if the context isn't usable for compositing.
-    virtual bool initializeLayerRenderer() = 0;
+    virtual bool initializeRenderer() = 0;
 
     // Attempts to recreate the context and layer renderer after a context lost. Returns false if the renderer couldn't be
     // reinitialized.
@@ -83,7 +83,7 @@ public:
 
     virtual void implSideRenderingStats(CCRenderingStats&) = 0;
 
-    virtual const LayerRendererCapabilities& layerRendererCapabilities() const = 0;
+    virtual const RendererCapabilities& rendererCapabilities() const = 0;
 
     virtual void setNeedsAnimate() = 0;
     virtual void setNeedsCommit() = 0;
index 11edbfa..ecaf992 100644 (file)
@@ -36,8 +36,6 @@
 #include "CCQuadSink.h"
 #include "CCRenderPassDrawQuad.h"
 #include "CCSharedQuadState.h"
-#include "GraphicsContext3D.h"
-#include "LayerRendererChromium.h"
 #include "TextStream.h"
 #include <public/WebTransformationMatrix.h>
 #include <wtf/text/CString.h>
index 0e518b2..9734788 100644 (file)
@@ -42,7 +42,6 @@ class CCDamageTracker;
 class CCQuadSink;
 class CCRenderPass;
 class CCLayerImpl;
-class LayerRendererChromium;
 class TextStream;
 
 class CCRenderSurface {
index 40ab241..946aec6 100644 (file)
@@ -66,7 +66,7 @@ public:
 
     virtual ~CCRenderer() { }
 
-    virtual const LayerRendererCapabilities& capabilities() const = 0;
+    virtual const RendererCapabilities& capabilities() const = 0;
 
     const CCLayerTreeSettings& settings() const { return m_client->settings(); }
 
@@ -32,7 +32,7 @@
 #include "config.h"
 
 #if USE(ACCELERATED_COMPOSITING)
-#include "LayerRendererChromium.h"
+#include "CCRendererGL.h"
 
 #include "CCDamageTracker.h"
 #include "CCLayerQuad.h"
@@ -83,16 +83,16 @@ bool needsIOSurfaceReadbackWorkaround()
 
 } // anonymous namespace
 
-PassOwnPtr<LayerRendererChromium> LayerRendererChromium::create(CCRendererClient* client, CCResourceProvider* resourceProvider, TextureUploaderOption textureUploaderSetting)
+PassOwnPtr<CCRendererGL> CCRendererGL::create(CCRendererClient* client, CCResourceProvider* resourceProvider, TextureUploaderOption textureUploaderSetting)
 {
-    OwnPtr<LayerRendererChromium> layerRenderer(adoptPtr(new LayerRendererChromium(client, resourceProvider, textureUploaderSetting)));
-    if (!layerRenderer->initialize())
+    OwnPtr<CCRendererGL> renderer(adoptPtr(new CCRendererGL(client, resourceProvider, textureUploaderSetting)));
+    if (!renderer->initialize())
         return nullptr;
 
-    return layerRenderer.release();
+    return renderer.release();
 }
 
-LayerRendererChromium::LayerRendererChromium(CCRendererClient* client,
+CCRendererGL::CCRendererGL(CCRendererClient* client,
                                              CCResourceProvider* resourceProvider,
                                              TextureUploaderOption textureUploaderSetting)
     : CCDirectRenderer(client, resourceProvider)
@@ -108,7 +108,7 @@ LayerRendererChromium::LayerRendererChromium(CCRendererClient* client,
     ASSERT(m_context);
 }
 
-bool LayerRendererChromium::initialize()
+bool CCRendererGL::initialize()
 {
     if (!m_context->makeContextCurrent())
         return false;
@@ -138,15 +138,13 @@ bool LayerRendererChromium::initialize()
     // Use the swapBuffers callback only with the threaded proxy.
     if (CCProxy::hasImplThread())
         m_capabilities.usingSwapCompleteCallback = extensions.contains("GL_CHROMIUM_swapbuffers_complete_callback");
-    if (m_capabilities.usingSwapCompleteCallback) {
+    if (m_capabilities.usingSwapCompleteCallback)
         m_context->setSwapBuffersCompleteCallbackCHROMIUM(this);
-    }
 
     m_capabilities.usingSetVisibility = extensions.contains("GL_CHROMIUM_set_visibility");
 
-    if (extensions.contains("GL_CHROMIUM_iosurface")) {
+    if (extensions.contains("GL_CHROMIUM_iosurface"))
         ASSERT(extensions.contains("GL_ARB_texture_rectangle"));
-    }
 
     m_capabilities.usingGpuMemoryManager = extensions.contains("GL_CHROMIUM_gpu_memory_manager");
     if (m_capabilities.usingGpuMemoryManager)
@@ -169,7 +167,7 @@ bool LayerRendererChromium::initialize()
     return true;
 }
 
-LayerRendererChromium::~LayerRendererChromium()
+CCRendererGL::~CCRendererGL()
 {
     ASSERT(CCProxy::isImplThread());
     m_context->setSwapBuffersCompleteCallbackCHROMIUM(0);
@@ -178,19 +176,19 @@ LayerRendererChromium::~LayerRendererChromium()
     cleanupSharedObjects();
 }
 
-WebGraphicsContext3D* LayerRendererChromium::context()
+WebGraphicsContext3D* CCRendererGL::context()
 {
     return m_context;
 }
 
-void LayerRendererChromium::debugGLCall(WebGraphicsContext3D* context, const char* command, const char* file, int line)
+void CCRendererGL::debugGLCall(WebGraphicsContext3D* context, const char* command, const char* file, int line)
 {
     unsigned long error = context->getError();
     if (error != GraphicsContext3D::NO_ERROR)
         LOG_ERROR("GL command failed: File: %s\n\tLine %d\n\tcommand: %s, error %x\n", file, line, command, static_cast<int>(error));
 }
 
-void LayerRendererChromium::setVisible(bool visible)
+void CCRendererGL::setVisible(bool visible)
 {
     if (m_visible == visible)
         return;
@@ -198,22 +196,21 @@ void LayerRendererChromium::setVisible(bool visible)
 
     // TODO: Replace setVisibilityCHROMIUM with an extension to explicitly manage front/backbuffers
     // crbug.com/116049
-    if (m_capabilities.usingSetVisibility) {
+    if (m_capabilities.usingSetVisibility)
         m_context->setVisibilityCHROMIUM(visible);
-    }
 }
 
-void LayerRendererChromium::releaseRenderPassTextures()
+void CCRendererGL::releaseRenderPassTextures()
 {
     m_renderPassTextures.clear();
 }
 
-void LayerRendererChromium::viewportChanged()
+void CCRendererGL::viewportChanged()
 {
     m_isViewportChanged = true;
 }
 
-void LayerRendererChromium::clearFramebuffer(DrawingFrame& frame)
+void CCRendererGL::clearFramebuffer(DrawingFrame& frame)
 {
     // On DEBUG builds, opaque render passes are cleared to blue to easily see regions that were not drawn on the screen.
     if (frame.currentRenderPass->hasTransparentBackground())
@@ -227,7 +224,7 @@ void LayerRendererChromium::clearFramebuffer(DrawingFrame& frame)
         m_context->clear(GraphicsContext3D::COLOR_BUFFER_BIT);
 }
 
-void LayerRendererChromium::beginDrawingFrame(DrawingFrame& frame)
+void CCRendererGL::beginDrawingFrame(DrawingFrame& frame)
 {
     // FIXME: Remove this once framebuffer is automatically recreated on first use
     ensureFramebuffer();
@@ -235,7 +232,7 @@ void LayerRendererChromium::beginDrawingFrame(DrawingFrame& frame)
     if (viewportSize().isEmpty())
         return;
 
-    TRACE_EVENT0("cc", "LayerRendererChromium::drawLayers");
+    TRACE_EVENT0("cc", "CCRendererGL::drawLayers");
     if (m_isViewportChanged) {
         // Only reshape when we know we are going to draw. Otherwise, the reshape
         // can leave the window at the wrong size if we never draw and the proper
@@ -255,13 +252,13 @@ void LayerRendererChromium::beginDrawingFrame(DrawingFrame& frame)
     GLC(m_context, m_context->blendFunc(GraphicsContext3D::ONE, GraphicsContext3D::ONE_MINUS_SRC_ALPHA));
 }
 
-void LayerRendererChromium::doNoOp()
+void CCRendererGL::doNoOp()
 {
     GLC(m_context, m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, 0));
     GLC(m_context, m_context->flush());
 }
 
-void LayerRendererChromium::drawQuad(DrawingFrame& frame, const CCDrawQuad* quad)
+void CCRendererGL::drawQuad(DrawingFrame& frame, const CCDrawQuad* quad)
 {
     if (quad->needsBlending())
         GLC(m_context, m_context->enable(GraphicsContext3D::BLEND));
@@ -302,7 +299,7 @@ void LayerRendererChromium::drawQuad(DrawingFrame& frame, const CCDrawQuad* quad
     }
 }
 
-void LayerRendererChromium::drawCheckerboardQuad(const DrawingFrame& frame, const CCCheckerboardDrawQuad* quad)
+void CCRendererGL::drawCheckerboardQuad(const DrawingFrame& frame, const CCCheckerboardDrawQuad* quad)
 {
     const TileCheckerboardProgram* program = tileCheckerboardProgram();
     ASSERT(program && program->initialized());
@@ -324,7 +321,7 @@ void LayerRendererChromium::drawCheckerboardQuad(const DrawingFrame& frame, cons
     drawQuadGeometry(frame, quad->quadTransform(), quad->quadRect(), program->vertexShader().matrixLocation());
 }
 
-void LayerRendererChromium::drawDebugBorderQuad(const DrawingFrame& frame, const CCDebugBorderDrawQuad* quad)
+void CCRendererGL::drawDebugBorderQuad(const DrawingFrame& frame, const CCDebugBorderDrawQuad* quad)
 {
     static float glMatrix[16];
     const SolidColorProgram* program = solidColorProgram();
@@ -336,7 +333,7 @@ void LayerRendererChromium::drawDebugBorderQuad(const DrawingFrame& frame, const
     WebTransformationMatrix renderMatrix = quad->quadTransform();
     renderMatrix.translate(0.5 * layerRect.width() + layerRect.x(), 0.5 * layerRect.height() + layerRect.y());
     renderMatrix.scaleNonUniform(layerRect.width(), layerRect.height());
-    LayerRendererChromium::toGLMatrix(&glMatrix[0], frame.projectionMatrix * renderMatrix);
+    CCRendererGL::toGLMatrix(&glMatrix[0], frame.projectionMatrix * renderMatrix);
     GLC(context(), context()->uniformMatrix4fv(program->vertexShader().matrixLocation(), 1, false, &glMatrix[0]));
 
     SkColor color = quad->color();
@@ -350,7 +347,7 @@ void LayerRendererChromium::drawDebugBorderQuad(const DrawingFrame& frame, const
     GLC(context(), context()->drawElements(GraphicsContext3D::LINE_LOOP, 4, GraphicsContext3D::UNSIGNED_SHORT, 6 * sizeof(unsigned short)));
 }
 
-static inline SkBitmap applyFilters(LayerRendererChromium* layerRenderer, const WebKit::WebFilterOperations& filters, CCScopedTexture* sourceTexture)
+static inline SkBitmap applyFilters(CCRendererGL* renderer, const WebKit::WebFilterOperations& filters, CCScopedTexture* sourceTexture)
 {
     if (filters.isEmpty())
         return SkBitmap();
@@ -361,14 +358,14 @@ static inline SkBitmap applyFilters(LayerRendererChromium* layerRenderer, const
     if (!filterContext || !filterGrContext)
         return SkBitmap();
 
-    layerRenderer->context()->flush();
+    renderer->context()->flush();
 
-    CCResourceProvider::ScopedWriteLockGL lock(layerRenderer->resourceProvider(), sourceTexture->id());
+    CCResourceProvider::ScopedWriteLockGL lock(renderer->resourceProvider(), sourceTexture->id());
     SkBitmap source = CCRenderSurfaceFilters::apply(filters, lock.textureId(), sourceTexture->size(), filterContext, filterGrContext);
     return source;
 }
 
-PassOwnPtr<CCScopedTexture> LayerRendererChromium::drawBackgroundFilters(DrawingFrame& frame, const CCRenderPassDrawQuad* quad, const WebKit::WebFilterOperations& filters, const WebTransformationMatrix& contentsDeviceTransform)
+PassOwnPtr<CCScopedTexture> CCRendererGL::drawBackgroundFilters(DrawingFrame& frame, const CCRenderPassDrawQuad* quad, const WebKit::WebFilterOperations& filters, const WebTransformationMatrix& contentsDeviceTransform)
 {
     // This method draws a background filter, which applies a filter to any pixels behind the quad and seen through its background.
     // The algorithm works as follows:
@@ -439,7 +436,7 @@ PassOwnPtr<CCScopedTexture> LayerRendererChromium::drawBackgroundFilters(Drawing
     return backgroundTexture.release();
 }
 
-void LayerRendererChromium::drawRenderPassQuad(DrawingFrame& frame, const CCRenderPassDrawQuad* quad)
+void CCRendererGL::drawRenderPassQuad(DrawingFrame& frame, const CCRenderPassDrawQuad* quad)
 {
     CachedTexture* contentsTexture = m_renderPassTextures.get(quad->renderPassId());
     if (!contentsTexture || !contentsTexture->id())
@@ -581,7 +578,7 @@ void LayerRendererChromium::drawRenderPassQuad(DrawingFrame& frame, const CCRend
     drawQuadGeometry(frame, quad->quadTransform(), quad->quadRect(), shaderMatrixLocation);
 }
 
-void LayerRendererChromium::drawSolidColorQuad(const DrawingFrame& frame, const CCSolidColorDrawQuad* quad)
+void CCRendererGL::drawSolidColorQuad(const DrawingFrame& frame, const CCSolidColorDrawQuad* quad)
 {
     const SolidColorProgram* program = solidColorProgram();
     GLC(context(), context()->useProgram(program->program()));
@@ -620,7 +617,7 @@ static void tileUniformLocation(T program, TileProgramUniforms& uniforms)
     uniforms.edgeLocation = program->fragmentShader().edgeLocation();
 }
 
-void LayerRendererChromium::drawTileQuad(const DrawingFrame& frame, const CCTileDrawQuad* quad)
+void CCRendererGL::drawTileQuad(const DrawingFrame& frame, const CCTileDrawQuad* quad)
 {
     IntRect tileRect = quad->quadVisibleRect();
 
@@ -754,7 +751,7 @@ void LayerRendererChromium::drawTileQuad(const DrawingFrame& frame, const CCTile
         localQuad = CCMathUtil::mapQuad(inverseDeviceTransform, deviceQuad.floatQuad(), clipped);
 
         // We should not ASSERT(!clipped) here, because anti-aliasing inflation may cause deviceQuad to become
-        // clipped.  To our knowledge this scenario does not need to be handled differently than the unclipped case.
+        // clipped. To our knowledge this scenario does not need to be handled differently than the unclipped case.
     } else {
         // Move fragment shader transform to vertex shader. We can do this while
         // still producing correct results as fragmentTexTransformLocation
@@ -787,7 +784,7 @@ void LayerRendererChromium::drawTileQuad(const DrawingFrame& frame, const CCTile
     drawQuadGeometry(frame, quad->quadTransform(), centeredRect, uniforms.matrixLocation);
 }
 
-void LayerRendererChromium::drawYUVVideoQuad(const DrawingFrame& frame, const CCYUVVideoDrawQuad* quad)
+void CCRendererGL::drawYUVVideoQuad(const DrawingFrame& frame, const CCYUVVideoDrawQuad* quad)
 {
     const VideoYUVProgram* program = videoYUVProgram();
     ASSERT(program && program->initialized());
@@ -847,7 +844,7 @@ void LayerRendererChromium::drawYUVVideoQuad(const DrawingFrame& frame, const CC
     GLC(context(), context()->activeTexture(GraphicsContext3D::TEXTURE0));
 }
 
-void LayerRendererChromium::drawStreamVideoQuad(const DrawingFrame& frame, const CCStreamVideoDrawQuad* quad)
+void CCRendererGL::drawStreamVideoQuad(const DrawingFrame& frame, const CCStreamVideoDrawQuad* quad)
 {
     static float glMatrix[16];
 
@@ -892,7 +889,7 @@ struct TexTransformTextureProgramBinding : TextureProgramBinding {
     int texTransformLocation;
 };
 
-void LayerRendererChromium::drawTextureQuad(const DrawingFrame& frame, const CCTextureDrawQuad* quad)
+void CCRendererGL::drawTextureQuad(const DrawingFrame& frame, const CCTextureDrawQuad* quad)
 {
     ASSERT(CCProxy::isImplThread());
 
@@ -936,7 +933,7 @@ void LayerRendererChromium::drawTextureQuad(const DrawingFrame& frame, const CCT
         GLC(m_context, m_context->blendFunc(GraphicsContext3D::ONE, GraphicsContext3D::ONE_MINUS_SRC_ALPHA));
 }
 
-void LayerRendererChromium::drawIOSurfaceQuad(const DrawingFrame& frame, const CCIOSurfaceDrawQuad* quad)
+void CCRendererGL::drawIOSurfaceQuad(const DrawingFrame& frame, const CCIOSurfaceDrawQuad* quad)
 {
     ASSERT(CCProxy::isImplThread());
     TexTransformTextureProgramBinding binding;
@@ -958,7 +955,7 @@ void LayerRendererChromium::drawIOSurfaceQuad(const DrawingFrame& frame, const C
     GLC(context(), context()->bindTexture(Extensions3D::TEXTURE_RECTANGLE_ARB, 0));
 }
 
-void LayerRendererChromium::finishDrawingFrame(DrawingFrame& frame)
+void CCRendererGL::finishDrawingFrame(DrawingFrame& frame)
 {
     m_currentFramebufferLock.clear();
     m_swapBufferRect.unite(enclosingIntRect(frame.rootDamageRect));
@@ -967,7 +964,7 @@ void LayerRendererChromium::finishDrawingFrame(DrawingFrame& frame)
     GLC(m_context, m_context->disable(GraphicsContext3D::BLEND));
 }
 
-void LayerRendererChromium::toGLMatrix(float* flattened, const WebTransformationMatrix& m)
+void CCRendererGL::toGLMatrix(float* flattened, const WebTransformationMatrix& m)
 {
     flattened[0] = m.m11();
     flattened[1] = m.m12();
@@ -987,7 +984,7 @@ void LayerRendererChromium::toGLMatrix(float* flattened, const WebTransformation
     flattened[15] = m.m44();
 }
 
-void LayerRendererChromium::setShaderFloatQuad(const FloatQuad& quad, int quadLocation)
+void CCRendererGL::setShaderFloatQuad(const FloatQuad& quad, int quadLocation)
 {
     if (quadLocation == -1)
         return;
@@ -1004,13 +1001,13 @@ void LayerRendererChromium::setShaderFloatQuad(const FloatQuad& quad, int quadLo
     GLC(m_context, m_context->uniform2fv(quadLocation, 4, point));
 }
 
-void LayerRendererChromium::setShaderOpacity(float opacity, int alphaLocation)
+void CCRendererGL::setShaderOpacity(float opacity, int alphaLocation)
 {
     if (alphaLocation != -1)
         GLC(m_context, m_context->uniform1f(alphaLocation, opacity));
 }
 
-void LayerRendererChromium::drawQuadGeometry(const DrawingFrame& frame, const WebKit::WebTransformationMatrix& drawTransform, const FloatRect& quadRect, int matrixLocation)
+void CCRendererGL::drawQuadGeometry(const DrawingFrame& frame, const WebKit::WebTransformationMatrix& drawTransform, const FloatRect& quadRect, int matrixLocation)
 {
     WebTransformationMatrix quadRectMatrix;
     quadRectTransform(&quadRectMatrix, drawTransform, quadRect);
@@ -1021,7 +1018,7 @@ void LayerRendererChromium::drawQuadGeometry(const DrawingFrame& frame, const We
     GLC(m_context, m_context->drawElements(GraphicsContext3D::TRIANGLES, 6, GraphicsContext3D::UNSIGNED_SHORT, 0));
 }
 
-void LayerRendererChromium::copyTextureToFramebuffer(const DrawingFrame& frame, int textureId, const IntRect& rect, const WebTransformationMatrix& drawMatrix)
+void CCRendererGL::copyTextureToFramebuffer(const DrawingFrame& frame, int textureId, const IntRect& rect, const WebTransformationMatrix& drawMatrix)
 {
     const RenderPassProgram* program = renderPassProgram();
 
@@ -1038,18 +1035,18 @@ void LayerRendererChromium::copyTextureToFramebuffer(const DrawingFrame& frame,
     drawQuadGeometry(frame, drawMatrix, rect, program->vertexShader().matrixLocation());
 }
 
-void LayerRendererChromium::finish()
+void CCRendererGL::finish()
 {
-    TRACE_EVENT0("cc", "LayerRendererChromium::finish");
+    TRACE_EVENT0("cc", "CCRendererGL::finish");
     m_context->finish();
 }
 
-bool LayerRendererChromium::swapBuffers()
+bool CCRendererGL::swapBuffers()
 {
     ASSERT(m_visible);
     ASSERT(!m_isFramebufferDiscarded);
 
-    TRACE_EVENT0("cc", "LayerRendererChromium::swapBuffers");
+    TRACE_EVENT0("cc", "CCRendererGL::swapBuffers");
     // We're done! Time to swapbuffers!
 
     if (m_capabilities.usingPartialSwap) {
@@ -1068,12 +1065,12 @@ bool LayerRendererChromium::swapBuffers()
     return true;
 }
 
-void LayerRendererChromium::onSwapBuffersComplete()
+void CCRendererGL::onSwapBuffersComplete()
 {
     m_client->onSwapBuffersComplete();
 }
 
-void LayerRendererChromium::onMemoryAllocationChanged(WebGraphicsMemoryAllocation allocation)
+void CCRendererGL::onMemoryAllocationChanged(WebGraphicsMemoryAllocation allocation)
 {
     // FIXME: This is called on the main thread in single threaded mode, but we expect it on the impl thread.
     if (!CCProxy::hasImplThread()) {
@@ -1086,7 +1083,7 @@ void LayerRendererChromium::onMemoryAllocationChanged(WebGraphicsMemoryAllocatio
     }
 }
 
-void LayerRendererChromium::onMemoryAllocationChangedOnImplThread(WebKit::WebGraphicsMemoryAllocation allocation)
+void CCRendererGL::onMemoryAllocationChangedOnImplThread(WebKit::WebGraphicsMemoryAllocation allocation)
 {
     if (m_visible && !allocation.gpuResourceSizeInBytes)
         return;
@@ -1102,7 +1099,7 @@ void LayerRendererChromium::onMemoryAllocationChangedOnImplThread(WebKit::WebGra
         m_client->setMemoryAllocationLimitBytes(allocation.gpuResourceSizeInBytes);
 }
 
-void LayerRendererChromium::discardFramebuffer()
+void CCRendererGL::discardFramebuffer()
 {
     if (m_isFramebufferDiscarded)
         return;
@@ -1118,7 +1115,7 @@ void LayerRendererChromium::discardFramebuffer()
     m_client->setFullRootLayerDamage();
 }
 
-void LayerRendererChromium::ensureFramebuffer()
+void CCRendererGL::ensureFramebuffer()
 {
     if (!m_isFramebufferDiscarded)
         return;
@@ -1130,13 +1127,13 @@ void LayerRendererChromium::ensureFramebuffer()
     m_isFramebufferDiscarded = false;
 }
 
-void LayerRendererChromium::onContextLost()
+void CCRendererGL::onContextLost()
 {
     m_client->didLoseContext();
 }
 
 
-void LayerRendererChromium::getFramebufferPixels(void *pixels, const IntRect& rect)
+void CCRendererGL::getFramebufferPixels(void *pixels, const IntRect& rect)
 {
     ASSERT(rect.maxX() <= viewportWidth() && rect.maxY() <= viewportHeight());
 
@@ -1184,7 +1181,7 @@ void LayerRendererChromium::getFramebufferPixels(void *pixels, const IntRect& re
     }
 
     if (!m_visible) {
-        TRACE_EVENT0("cc", "LayerRendererChromium::getFramebufferPixels dropping resources after readback");
+        TRACE_EVENT0("cc", "CCRendererGL::getFramebufferPixels dropping resources after readback");
         discardFramebuffer();
         releaseRenderPassTextures();
         m_client->releaseContentsTextures();
@@ -1192,7 +1189,7 @@ void LayerRendererChromium::getFramebufferPixels(void *pixels, const IntRect& re
     }
 }
 
-bool LayerRendererChromium::getFramebufferTexture(CCScopedTexture* texture, const IntRect& deviceRect)
+bool CCRendererGL::getFramebufferTexture(CCScopedTexture* texture, const IntRect& deviceRect)
 {
     ASSERT(!texture->id() || (texture->size() == deviceRect.size() && texture->format() == GraphicsContext3D::RGB));
 
@@ -1206,7 +1203,7 @@ bool LayerRendererChromium::getFramebufferTexture(CCScopedTexture* texture, cons
     return true;
 }
 
-bool LayerRendererChromium::useScopedTexture(DrawingFrame& frame, const CCScopedTexture* texture, const IntRect& viewportRect)
+bool CCRendererGL::useScopedTexture(DrawingFrame& frame, const CCScopedTexture* texture, const IntRect& viewportRect)
 {
     ASSERT(texture->id());
     frame.currentRenderPass = 0;
@@ -1215,13 +1212,13 @@ bool LayerRendererChromium::useScopedTexture(DrawingFrame& frame, const CCScoped
     return bindFramebufferToTexture(frame, texture, viewportRect);
 }
 
-void LayerRendererChromium::bindFramebufferToOutputSurface(DrawingFrame& frame)
+void CCRendererGL::bindFramebufferToOutputSurface(DrawingFrame& frame)
 {
     m_currentFramebufferLock.clear();
     GLC(m_context, m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, 0));
 }
 
-bool LayerRendererChromium::bindFramebufferToTexture(DrawingFrame& frame, const CCScopedTexture* texture, const IntRect& framebufferRect)
+bool CCRendererGL::bindFramebufferToTexture(DrawingFrame& frame, const CCScopedTexture* texture, const IntRect& framebufferRect)
 {
     ASSERT(texture->id());
 
@@ -1243,30 +1240,30 @@ bool LayerRendererChromium::bindFramebufferToTexture(DrawingFrame& frame, const
     return true;
 }
 
-void LayerRendererChromium::enableScissorTestRect(const IntRect& scissorRect)
+void CCRendererGL::enableScissorTestRect(const IntRect& scissorRect)
 {
     GLC(m_context, m_context->enable(GraphicsContext3D::SCISSOR_TEST));
     GLC(m_context, m_context->scissor(scissorRect.x(), scissorRect.y(), scissorRect.width(), scissorRect.height()));
 }
 
-void LayerRendererChromium::disableScissorTest()
+void CCRendererGL::disableScissorTest()
 {
     GLC(m_context, m_context->disable(GraphicsContext3D::SCISSOR_TEST));
 }
 
-void LayerRendererChromium::setDrawViewportSize(const IntSize& viewportSize)
+void CCRendererGL::setDrawViewportSize(const IntSize& viewportSize)
 {
     GLC(m_context, m_context->viewport(0, 0, viewportSize.width(), viewportSize.height()));
 }
 
-bool LayerRendererChromium::makeContextCurrent()
+bool CCRendererGL::makeContextCurrent()
 {
     return m_context->makeContextCurrent();
 }
 
-bool LayerRendererChromium::initializeSharedObjects()
+bool CCRendererGL::initializeSharedObjects()
 {
-    TRACE_EVENT0("cc", "LayerRendererChromium::initializeSharedObjects");
+    TRACE_EVENT0("cc", "CCRendererGL::initializeSharedObjects");
     makeContextCurrent();
 
     // Create an FBO for doing offscreen rendering.
@@ -1290,191 +1287,191 @@ bool LayerRendererChromium::initializeSharedObjects()
     return true;
 }
 
-const LayerRendererChromium::TileCheckerboardProgram* LayerRendererChromium::tileCheckerboardProgram()
+const CCRendererGL::TileCheckerboardProgram* CCRendererGL::tileCheckerboardProgram()
 {
     if (!m_tileCheckerboardProgram)
         m_tileCheckerboardProgram = adoptPtr(new TileCheckerboardProgram(m_context));
     if (!m_tileCheckerboardProgram->initialized()) {
-        TRACE_EVENT0("cc", "LayerRendererChromium::checkerboardProgram::initalize");
+        TRACE_EVENT0("cc", "CCRendererGL::checkerboardProgram::initalize");
         m_tileCheckerboardProgram->initialize(m_context, m_isUsingBindUniform);
     }
     return m_tileCheckerboardProgram.get();
 }
 
-const LayerRendererChromium::SolidColorProgram* LayerRendererChromium::solidColorProgram()
+const CCRendererGL::SolidColorProgram* CCRendererGL::solidColorProgram()
 {
     if (!m_solidColorProgram)
         m_solidColorProgram = adoptPtr(new SolidColorProgram(m_context));
     if (!m_solidColorProgram->initialized()) {
-        TRACE_EVENT0("cc", "LayerRendererChromium::solidColorProgram::initialize");
+        TRACE_EVENT0("cc", "CCRendererGL::solidColorProgram::initialize");
         m_solidColorProgram->initialize(m_context, m_isUsingBindUniform);
     }
     return m_solidColorProgram.get();
 }
 
-const LayerRendererChromium::RenderPassProgram* LayerRendererChromium::renderPassProgram()
+const CCRendererGL::RenderPassProgram* CCRendererGL::renderPassProgram()
 {
     ASSERT(m_renderPassProgram);
     if (!m_renderPassProgram->initialized()) {
-        TRACE_EVENT0("cc", "LayerRendererChromium::renderPassProgram::initialize");
+        TRACE_EVENT0("cc", "CCRendererGL::renderPassProgram::initialize");
         m_renderPassProgram->initialize(m_context, m_isUsingBindUniform);
     }
     return m_renderPassProgram.get();
 }
 
-const LayerRendererChromium::RenderPassProgramAA* LayerRendererChromium::renderPassProgramAA()
+const CCRendererGL::RenderPassProgramAA* CCRendererGL::renderPassProgramAA()
 {
     if (!m_renderPassProgramAA)
         m_renderPassProgramAA = adoptPtr(new RenderPassProgramAA(m_context));
     if (!m_renderPassProgramAA->initialized()) {
-        TRACE_EVENT0("cc", "LayerRendererChromium::renderPassProgramAA::initialize");
+        TRACE_EVENT0("cc", "CCRendererGL::renderPassProgramAA::initialize");
         m_renderPassProgramAA->initialize(m_context, m_isUsingBindUniform);
     }
     return m_renderPassProgramAA.get();
 }
 
-const LayerRendererChromium::RenderPassMaskProgram* LayerRendererChromium::renderPassMaskProgram()
+const CCRendererGL::RenderPassMaskProgram* CCRendererGL::renderPassMaskProgram()
 {
     if (!m_renderPassMaskProgram)
         m_renderPassMaskProgram = adoptPtr(new RenderPassMaskProgram(m_context));
     if (!m_renderPassMaskProgram->initialized()) {
-        TRACE_EVENT0("cc", "LayerRendererChromium::renderPassMaskProgram::initialize");
+        TRACE_EVENT0("cc", "CCRendererGL::renderPassMaskProgram::initialize");
         m_renderPassMaskProgram->initialize(m_context, m_isUsingBindUniform);
     }
     return m_renderPassMaskProgram.get();
 }
 
-const LayerRendererChromium::RenderPassMaskProgramAA* LayerRendererChromium::renderPassMaskProgramAA()
+const CCRendererGL::RenderPassMaskProgramAA* CCRendererGL::renderPassMaskProgramAA()
 {
     if (!m_renderPassMaskProgramAA)
         m_renderPassMaskProgramAA = adoptPtr(new RenderPassMaskProgramAA(m_context));
     if (!m_renderPassMaskProgramAA->initialized()) {
-        TRACE_EVENT0("cc", "LayerRendererChromium::renderPassMaskProgramAA::initialize");
+        TRACE_EVENT0("cc", "CCRendererGL::renderPassMaskProgramAA::initialize");
         m_renderPassMaskProgramAA->initialize(m_context, m_isUsingBindUniform);
     }
     return m_renderPassMaskProgramAA.get();
 }
 
-const LayerRendererChromium::TileProgram* LayerRendererChromium::tileProgram()
+const CCRendererGL::TileProgram* CCRendererGL::tileProgram()
 {
     ASSERT(m_tileProgram);
     if (!m_tileProgram->initialized()) {
-        TRACE_EVENT0("cc", "LayerRendererChromium::tileProgram::initialize");
+        TRACE_EVENT0("cc", "CCRendererGL::tileProgram::initialize");
         m_tileProgram->initialize(m_context, m_isUsingBindUniform);
     }
     return m_tileProgram.get();
 }
 
-const LayerRendererChromium::TileProgramOpaque* LayerRendererChromium::tileProgramOpaque()
+const CCRendererGL::TileProgramOpaque* CCRendererGL::tileProgramOpaque()
 {
     ASSERT(m_tileProgramOpaque);
     if (!m_tileProgramOpaque->initialized()) {
-        TRACE_EVENT0("cc", "LayerRendererChromium::tileProgramOpaque::initialize");
+        TRACE_EVENT0("cc", "CCRendererGL::tileProgramOpaque::initialize");
         m_tileProgramOpaque->initialize(m_context, m_isUsingBindUniform);
     }
     return m_tileProgramOpaque.get();
 }
 
-const LayerRendererChromium::TileProgramAA* LayerRendererChromium::tileProgramAA()
+const CCRendererGL::TileProgramAA* CCRendererGL::tileProgramAA()
 {
     if (!m_tileProgramAA)
         m_tileProgramAA = adoptPtr(new TileProgramAA(m_context));
     if (!m_tileProgramAA->initialized()) {
-        TRACE_EVENT0("cc", "LayerRendererChromium::tileProgramAA::initialize");
+        TRACE_EVENT0("cc", "CCRendererGL::tileProgramAA::initialize");
         m_tileProgramAA->initialize(m_context, m_isUsingBindUniform);
     }
     return m_tileProgramAA.get();
 }
 
-const LayerRendererChromium::TileProgramSwizzle* LayerRendererChromium::tileProgramSwizzle()
+const CCRendererGL::TileProgramSwizzle* CCRendererGL::tileProgramSwizzle()
 {
     if (!m_tileProgramSwizzle)
         m_tileProgramSwizzle = adoptPtr(new TileProgramSwizzle(m_context));
     if (!m_tileProgramSwizzle->initialized()) {
-        TRACE_EVENT0("cc", "LayerRendererChromium::tileProgramSwizzle::initialize");
+        TRACE_EVENT0("cc", "CCRendererGL::tileProgramSwizzle::initialize");
         m_tileProgramSwizzle->initialize(m_context, m_isUsingBindUniform);
     }
     return m_tileProgramSwizzle.get();
 }
 
-const LayerRendererChromium::TileProgramSwizzleOpaque* LayerRendererChromium::tileProgramSwizzleOpaque()
+const CCRendererGL::TileProgramSwizzleOpaque* CCRendererGL::tileProgramSwizzleOpaque()
 {
     if (!m_tileProgramSwizzleOpaque)
         m_tileProgramSwizzleOpaque = adoptPtr(new TileProgramSwizzleOpaque(m_context));
     if (!m_tileProgramSwizzleOpaque->initialized()) {
-        TRACE_EVENT0("cc", "LayerRendererChromium::tileProgramSwizzleOpaque::initialize");
+        TRACE_EVENT0("cc", "CCRendererGL::tileProgramSwizzleOpaque::initialize");
         m_tileProgramSwizzleOpaque->initialize(m_context, m_isUsingBindUniform);
     }
     return m_tileProgramSwizzleOpaque.get();
 }
 
-const LayerRendererChromium::TileProgramSwizzleAA* LayerRendererChromium::tileProgramSwizzleAA()
+const CCRendererGL::TileProgramSwizzleAA* CCRendererGL::tileProgramSwizzleAA()
 {
     if (!m_tileProgramSwizzleAA)
         m_tileProgramSwizzleAA = adoptPtr(new TileProgramSwizzleAA(m_context));
     if (!m_tileProgramSwizzleAA->initialized()) {
-        TRACE_EVENT0("cc", "LayerRendererChromium::tileProgramSwizzleAA::initialize");
+        TRACE_EVENT0("cc", "CCRendererGL::tileProgramSwizzleAA::initialize");
         m_tileProgramSwizzleAA->initialize(m_context, m_isUsingBindUniform);
     }
     return m_tileProgramSwizzleAA.get();
 }
 
-const LayerRendererChromium::TextureProgram* LayerRendererChromium::textureProgram()
+const CCRendererGL::TextureProgram* CCRendererGL::textureProgram()
 {
     if (!m_textureProgram)
         m_textureProgram = adoptPtr(new TextureProgram(m_context));
     if (!m_textureProgram->initialized()) {
-        TRACE_EVENT0("cc", "LayerRendererChromium::textureProgram::initialize");
+        TRACE_EVENT0("cc", "CCRendererGL::textureProgram::initialize");
         m_textureProgram->initialize(m_context, m_isUsingBindUniform);
     }
     return m_textureProgram.get();
 }
 
-const LayerRendererChromium::TextureProgramFlip* LayerRendererChromium::textureProgramFlip()
+const CCRendererGL::TextureProgramFlip* CCRendererGL::textureProgramFlip()
 {
     if (!m_textureProgramFlip)
         m_textureProgramFlip = adoptPtr(new TextureProgramFlip(m_context));
     if (!m_textureProgramFlip->initialized()) {
-        TRACE_EVENT0("cc", "LayerRendererChromium::textureProgramFlip::initialize");
+        TRACE_EVENT0("cc", "CCRendererGL::textureProgramFlip::initialize");
         m_textureProgramFlip->initialize(m_context, m_isUsingBindUniform);
     }
     return m_textureProgramFlip.get();
 }
 
-const LayerRendererChromium::TextureIOSurfaceProgram* LayerRendererChromium::textureIOSurfaceProgram()
+const CCRendererGL::TextureIOSurfaceProgram* CCRendererGL::textureIOSurfaceProgram()
 {
     if (!m_textureIOSurfaceProgram)
         m_textureIOSurfaceProgram = adoptPtr(new TextureIOSurfaceProgram(m_context));
     if (!m_textureIOSurfaceProgram->initialized()) {
-        TRACE_EVENT0("cc", "LayerRendererChromium::textureIOSurfaceProgram::initialize");
+        TRACE_EVENT0("cc", "CCRendererGL::textureIOSurfaceProgram::initialize");
         m_textureIOSurfaceProgram->initialize(m_context, m_isUsingBindUniform);
     }
     return m_textureIOSurfaceProgram.get();
 }
 
-const LayerRendererChromium::VideoYUVProgram* LayerRendererChromium::videoYUVProgram()
+const CCRendererGL::VideoYUVProgram* CCRendererGL::videoYUVProgram()
 {
     if (!m_videoYUVProgram)
         m_videoYUVProgram = adoptPtr(new VideoYUVProgram(m_context));
     if (!m_videoYUVProgram->initialized()) {
-        TRACE_EVENT0("cc", "LayerRendererChromium::videoYUVProgram::initialize");
+        TRACE_EVENT0("cc", "CCRendererGL::videoYUVProgram::initialize");
         m_videoYUVProgram->initialize(m_context, m_isUsingBindUniform);
     }
     return m_videoYUVProgram.get();
 }
 
-const LayerRendererChromium::VideoStreamTextureProgram* LayerRendererChromium::videoStreamTextureProgram()
+const CCRendererGL::VideoStreamTextureProgram* CCRendererGL::videoStreamTextureProgram()
 {
     if (!m_videoStreamTextureProgram)
         m_videoStreamTextureProgram = adoptPtr(new VideoStreamTextureProgram(m_context));
     if (!m_videoStreamTextureProgram->initialized()) {
-        TRACE_EVENT0("cc", "LayerRendererChromium::streamTextureProgram::initialize");
+        TRACE_EVENT0("cc", "CCRendererGL::streamTextureProgram::initialize");
         m_videoStreamTextureProgram->initialize(m_context, m_isUsingBindUniform);
     }
     return m_videoStreamTextureProgram.get();
 }
 
-void LayerRendererChromium::cleanupSharedObjects()
+void CCRendererGL::cleanupSharedObjects()
 {
     makeContextCurrent();
 
@@ -1528,7 +1525,7 @@ void LayerRendererChromium::cleanupSharedObjects()
     releaseRenderPassTextures();
 }
 
-bool LayerRendererChromium::isContextLost()
+bool CCRendererGL::isContextLost()
 {
     return (m_context->getGraphicsResetStatusARB() != GraphicsContext3D::NO_ERROR);
 }
@@ -29,8 +29,8 @@
  */
 
 
-#ifndef LayerRendererChromium_h
-#define LayerRendererChromium_h
+#ifndef CCRendererGL_h
+#define CCRendererGL_h
 
 #if USE(ACCELERATED_COMPOSITING)
 
@@ -60,17 +60,17 @@ class GeometryBinding;
 class ScopedEnsureFramebufferAllocation;
 
 // Class that handles drawing of composited render layers using GL.
-class LayerRendererChromium : public CCDirectRenderer,
-                              public WebKit::WebGraphicsContext3D::WebGraphicsSwapBuffersCompleteCallbackCHROMIUM,
-                              public WebKit::WebGraphicsContext3D::WebGraphicsMemoryAllocationChangedCallbackCHROMIUM ,
-                              public WebKit::WebGraphicsContext3D::WebGraphicsContextLostCallback {
-    WTF_MAKE_NONCOPYABLE(LayerRendererChromium);
+class CCRendererGL : public CCDirectRenderer,
+                     public WebKit::WebGraphicsContext3D::WebGraphicsSwapBuffersCompleteCallbackCHROMIUM,
+                     public WebKit::WebGraphicsContext3D::WebGraphicsMemoryAllocationChangedCallbackCHROMIUM ,
+                     public WebKit::WebGraphicsContext3D::WebGraphicsContextLostCallback {
+    WTF_MAKE_NONCOPYABLE(CCRendererGL);
 public:
-    static PassOwnPtr<LayerRendererChromium> create(CCRendererClient*, CCResourceProvider*, TextureUploaderOption);
+    static PassOwnPtr<CCRendererGL> create(CCRendererClient*, CCResourceProvider*, TextureUploaderOption);
 
-    virtual ~LayerRendererChromium();
+    virtual ~CCRendererGL();
 
-    virtual const LayerRendererCapabilities& capabilities() const OVERRIDE { return m_capabilities; }
+    virtual const RendererCapabilities& capabilities() const OVERRIDE { return m_capabilities; }
 
     WebKit::WebGraphicsContext3D* context();
 
@@ -100,7 +100,7 @@ public:
     virtual void setVisible(bool) OVERRIDE;
 
 protected:
-    LayerRendererChromium(CCRendererClient*, CCResourceProvider*, TextureUploaderOption);
+    CCRendererGL(CCRendererClient*, CCResourceProvider*, TextureUploaderOption);
 
     bool isFramebufferDiscarded() const { return m_isFramebufferDiscarded; }
     bool initialize();
@@ -156,7 +156,7 @@ private:
     // WebGraphicsContext3D::WebGraphicsContextLostCallback implementation.
     virtual void onContextLost() OVERRIDE;
 
-    LayerRendererCapabilities m_capabilities;
+    RendererCapabilities m_capabilities;
 
     unsigned m_offscreenFramebufferId;
 
@@ -258,7 +258,7 @@ private:
 #define DEBUG_GL_CALLS 0
 
 #if DEBUG_GL_CALLS && !defined ( NDEBUG )
-#define GLC(context, x) (x, LayerRendererChromium::debugGLCall(&*context, #x, __FILE__, __LINE__))
+#define GLC(context, x) (x, CCRendererGL::debugGLCall(&*context, #x, __FILE__, __LINE__))
 #else
 #define GLC(context, x) (x)
 #endif
index fb36b4c..3aad147 100644 (file)
@@ -27,9 +27,9 @@
 #include "CCResourceProvider.h"
 
 #include "CCProxy.h"
+#include "CCRendererGL.h" // For the GLC() macro.
 #include "Extensions3DChromium.h"
 #include "IntRect.h"
-#include "LayerRendererChromium.h" // For the GLC() macro
 #include "LayerTextureSubImage.h"
 #include <limits.h>
 #include <public/WebGraphicsContext3D.h>
index 88a8ffb..e84eb33 100644 (file)
@@ -47,7 +47,7 @@ CCSingleThreadProxy::CCSingleThreadProxy(CCLayerTreeHost* layerTreeHost)
     : m_layerTreeHost(layerTreeHost)
     , m_contextLost(false)
     , m_compositorIdentifier(-1)
-    , m_layerRendererInitialized(false)
+    , m_rendererInitialized(false)
     , m_nextFrameIsNewlyCommittedFrame(false)
 {
     TRACE_EVENT0("cc", "CCSingleThreadProxy::CCSingleThreadProxy");
@@ -127,16 +127,16 @@ void CCSingleThreadProxy::setVisible(bool visible)
     m_layerTreeHostImpl->setVisible(visible);
 }
 
-bool CCSingleThreadProxy::initializeLayerRenderer()
+bool CCSingleThreadProxy::initializeRenderer()
 {
     ASSERT(CCProxy::isMainThread());
     ASSERT(m_contextBeforeInitialization);
     {
         DebugScopedSetImplThread impl;
-        bool ok = m_layerTreeHostImpl->initializeLayerRenderer(m_contextBeforeInitialization.release(), UnthrottledUploader);
+        bool ok = m_layerTreeHostImpl->initializeRenderer(m_contextBeforeInitialization.release(), UnthrottledUploader);
         if (ok) {
-            m_layerRendererInitialized = true;
-            m_layerRendererCapabilitiesForMainThread = m_layerTreeHostImpl->layerRendererCapabilities();
+            m_rendererInitialized = true;
+            m_RendererCapabilitiesForMainThread = m_layerTreeHostImpl->rendererCapabilities();
         }
 
         return ok;
@@ -157,9 +157,9 @@ bool CCSingleThreadProxy::recreateContext()
     {
         DebugScopedSetImplThread impl;
         m_layerTreeHost->deleteContentsTexturesOnImplThread(m_layerTreeHostImpl->resourceProvider());
-        initialized = m_layerTreeHostImpl->initializeLayerRenderer(context.release(), UnthrottledUploader);
+        initialized = m_layerTreeHostImpl->initializeRenderer(context.release(), UnthrottledUploader);
         if (initialized) {
-            m_layerRendererCapabilitiesForMainThread = m_layerTreeHostImpl->layerRendererCapabilities();
+            m_RendererCapabilitiesForMainThread = m_layerTreeHostImpl->rendererCapabilities();
         }
     }
 
@@ -174,11 +174,11 @@ void CCSingleThreadProxy::implSideRenderingStats(CCRenderingStats& stats)
     m_layerTreeHostImpl->renderingStats(stats);
 }
 
-const LayerRendererCapabilities& CCSingleThreadProxy::layerRendererCapabilities() const
+const RendererCapabilities& CCSingleThreadProxy::rendererCapabilities() const
 {
-    ASSERT(m_layerRendererInitialized);
+    ASSERT(m_rendererInitialized);
     // Note: this gets called during the commit by the "impl" thread
-    return m_layerRendererCapabilitiesForMainThread;
+    return m_RendererCapabilitiesForMainThread;
 }
 
 void CCSingleThreadProxy::loseContext()
@@ -212,7 +212,7 @@ void CCSingleThreadProxy::doCommit(CCTextureUpdateQueue& queue)
         // single thread mode. For correctness, loop until no more updates are
         // pending.
         while (queue.hasMoreUpdates())
-            CCTextureUpdateController::updateTextures(m_layerTreeHostImpl->resourceProvider(), m_layerTreeHostImpl->layerRenderer()->textureCopier(), m_layerTreeHostImpl->layerRenderer()->textureUploader(), &queue, maxPartialTextureUpdates());
+            CCTextureUpdateController::updateTextures(m_layerTreeHostImpl->resourceProvider(), m_layerTreeHostImpl->renderer()->textureCopier(), m_layerTreeHostImpl->renderer()->textureUploader(), &queue, maxPartialTextureUpdates());
 
         m_layerTreeHost->finishCommitOnImplThread(m_layerTreeHostImpl.get());
 
@@ -287,8 +287,8 @@ void CCSingleThreadProxy::forceSerializeOnSwapBuffers()
 {
     {
         DebugScopedSetImplThread impl;
-        if (m_layerRendererInitialized)
-            m_layerTreeHostImpl->layerRenderer()->doNoOp();
+        if (m_rendererInitialized)
+            m_layerTreeHostImpl->renderer()->doNoOp();
     }
 }
 
@@ -297,7 +297,7 @@ bool CCSingleThreadProxy::commitAndComposite()
     ASSERT(CCProxy::isMainThread());
 
 
-    if (!m_layerTreeHost->initializeLayerRendererIfNeeded())
+    if (!m_layerTreeHost->initializeRendererIfNeeded())
         return false;
 
     if (m_layerTreeHostImpl->contentsTexturesPurged())
index 7f80478..a73a6aa 100644 (file)
@@ -48,11 +48,11 @@ public:
     virtual bool initializeContext() OVERRIDE;
     virtual void setSurfaceReady() OVERRIDE;
     virtual void setVisible(bool) OVERRIDE;
-    virtual bool initializeLayerRenderer() OVERRIDE;
+    virtual bool initializeRenderer() OVERRIDE;
     virtual bool recreateContext() OVERRIDE;
     virtual int compositorIdentifier() const OVERRIDE { return m_compositorIdentifier; }
     virtual void implSideRenderingStats(CCRenderingStats&) OVERRIDE;
-    virtual const LayerRendererCapabilities& layerRendererCapabilities() const OVERRIDE;
+    virtual const RendererCapabilities& rendererCapabilities() const OVERRIDE;
     virtual void loseContext() OVERRIDE;
     virtual void setNeedsAnimate() OVERRIDE;
     virtual void setNeedsCommit() OVERRIDE;
@@ -89,14 +89,14 @@ private:
     bool m_contextLost;
     int m_compositorIdentifier;
 
-    // Holds on to the context between initializeContext() and initializeLayerRenderer() calls. Shouldn't
+    // Holds on to the context between initializeContext() and initializeRenderer() calls. Shouldn't
     // be used for anything else.
     OwnPtr<CCGraphicsContext> m_contextBeforeInitialization;
 
     // Used on the CCThread, but checked on main thread during initialization/shutdown.
     OwnPtr<CCLayerTreeHostImpl> m_layerTreeHostImpl;
-    bool m_layerRendererInitialized;
-    LayerRendererCapabilities m_layerRendererCapabilitiesForMainThread;
+    bool m_rendererInitialized;
+    RendererCapabilities m_RendererCapabilitiesForMainThread;
 
     bool m_nextFrameIsNewlyCommittedFrame;
 };
index d19a230..e43c197 100644 (file)
@@ -31,8 +31,6 @@
 
 namespace WebCore {
 
-class LayerRendererChromium;
-
 class CCSolidColorLayerImpl : public CCLayerImpl {
 public:
     static PassOwnPtr<CCSolidColorLayerImpl> create(int id)
index 297b135..90743fd 100644 (file)
@@ -71,7 +71,7 @@ CCThreadProxy::CCThreadProxy(CCLayerTreeHost* layerTreeHost)
     , m_forcedCommitRequested(false)
     , m_layerTreeHost(layerTreeHost)
     , m_compositorIdentifier(-1)
-    , m_layerRendererInitialized(false)
+    , m_rendererInitialized(false)
     , m_started(false)
     , m_texturesAcquired(true)
     , m_inCompositeAndReadback(false)
@@ -101,7 +101,7 @@ bool CCThreadProxy::compositeAndReadback(void *pixels, const IntRect& rect)
     ASSERT(isMainThread());
     ASSERT(m_layerTreeHost);
 
-    if (!m_layerTreeHost->initializeLayerRendererIfNeeded()) {
+    if (!m_layerTreeHost->initializeRendererIfNeeded()) {
         TRACE_EVENT0("cc", "compositeAndReadback_EarlyOut_LR_Uninitialized");
         return false;
     }
@@ -208,23 +208,23 @@ void CCThreadProxy::setVisibleOnImplThread(CCCompletionEvent* completion, bool v
     completion->signal();
 }
 
-bool CCThreadProxy::initializeLayerRenderer()
+bool CCThreadProxy::initializeRenderer()
 {
-    TRACE_EVENT0("cc", "CCThreadProxy::initializeLayerRenderer");
-    // Make a blocking call to initializeLayerRendererOnImplThread. The results of that call
+    TRACE_EVENT0("cc", "CCThreadProxy::initializeRenderer");
+    // Make a blocking call to initializeRendererOnImplThread. The results of that call
     // are pushed into the initializeSucceeded and capabilities local variables.
     CCCompletionEvent completion;
     bool initializeSucceeded = false;
-    LayerRendererCapabilities capabilities;
-    CCProxy::implThread()->postTask(createCCThreadTask(this, &CCThreadProxy::initializeLayerRendererOnImplThread,
+    RendererCapabilities capabilities;
+    CCProxy::implThread()->postTask(createCCThreadTask(this, &CCThreadProxy::initializeRendererOnImplThread,
                                                        &completion,
                                                        &initializeSucceeded,
                                                        &capabilities));
     completion.wait();
 
     if (initializeSucceeded) {
-        m_layerRendererInitialized = true;
-        m_layerRendererCapabilitiesMainThreadCopy = capabilities;
+        m_rendererInitialized = true;
+        m_RendererCapabilitiesMainThreadCopy = capabilities;
     }
     return initializeSucceeded;
 }
@@ -247,7 +247,7 @@ bool CCThreadProxy::recreateContext()
     // variables.
     CCCompletionEvent completion;
     bool recreateSucceeded = false;
-    LayerRendererCapabilities capabilities;
+    RendererCapabilities capabilities;
     CCProxy::implThread()->postTask(createCCThreadTask(this, &CCThreadProxy::recreateContextOnImplThread,
                                                        &completion,
                                                        context.leakPtr(),
@@ -256,7 +256,7 @@ bool CCThreadProxy::recreateContext()
     completion.wait();
 
     if (recreateSucceeded)
-        m_layerRendererCapabilitiesMainThreadCopy = capabilities;
+        m_RendererCapabilitiesMainThreadCopy = capabilities;
     return recreateSucceeded;
 }
 
@@ -277,10 +277,10 @@ void CCThreadProxy::implSideRenderingStats(CCRenderingStats& stats)
     completion.wait();
 }
 
-const LayerRendererCapabilities& CCThreadProxy::layerRendererCapabilities() const
+const RendererCapabilities& CCThreadProxy::rendererCapabilities() const
 {
-    ASSERT(m_layerRendererInitialized);
-    return m_layerRendererCapabilitiesMainThreadCopy;
+    ASSERT(m_rendererInitialized);
+    return m_RendererCapabilitiesMainThreadCopy;
 }
 
 void CCThreadProxy::loseContext()
@@ -418,8 +418,8 @@ void CCThreadProxy::forceSerializeOnSwapBuffers()
 
 void CCThreadProxy::forceSerializeOnSwapBuffersOnImplThread(CCCompletionEvent* completion)
 {
-    if (m_layerRendererInitialized)
-        m_layerTreeHostImpl->layerRenderer()->doNoOp();
+    if (m_rendererInitialized)
+        m_layerTreeHostImpl->renderer()->doNoOp();
     completion->signal();
 }
 
@@ -517,7 +517,7 @@ void CCThreadProxy::beginFrame()
     m_commitRequested = false;
     m_forcedCommitRequested = false;
 
-    if (!m_layerTreeHost->initializeLayerRendererIfNeeded())
+    if (!m_layerTreeHost->initializeRendererIfNeeded())
         return;
 
     if (request->contentsTexturesWereDeleted)
@@ -577,7 +577,7 @@ void CCThreadProxy::beginFrameCompleteOnImplThread(CCCompletionEvent* completion
     } else
         m_resetContentsTexturesPurgedAfterCommitOnImplThread = true;
 
-    m_currentTextureUpdateControllerOnImplThread = CCTextureUpdateController::create(CCProxy::implThread(), queue, m_layerTreeHostImpl->resourceProvider(), m_layerTreeHostImpl->layerRenderer()->textureCopier(), m_layerTreeHostImpl->layerRenderer()->textureUploader());
+    m_currentTextureUpdateControllerOnImplThread = CCTextureUpdateController::create(CCProxy::implThread(), queue, m_layerTreeHostImpl->resourceProvider(), m_layerTreeHostImpl->renderer()->textureCopier(), m_layerTreeHostImpl->renderer()->textureUploader());
     m_commitCompletionEventOnImplThread = completion;
 
     m_schedulerOnImplThread->beginFrameComplete();
@@ -663,8 +663,8 @@ CCScheduledActionDrawAndSwapResult CCThreadProxy::scheduledActionDrawAndSwapInte
     if (!m_layerTreeHostImpl)
         return result;
 
-    ASSERT(m_layerTreeHostImpl->layerRenderer());
-    if (!m_layerTreeHostImpl->layerRenderer())
+    ASSERT(m_layerTreeHostImpl->renderer());
+    if (!m_layerTreeHostImpl->renderer())
         return result;
 
     // FIXME: compute the frame display time more intelligently
@@ -850,14 +850,14 @@ void CCThreadProxy::initializeContextOnImplThread(CCGraphicsContext* context)
     m_contextBeforeInitializationOnImplThread = adoptPtr(context);
 }
 
-void CCThreadProxy::initializeLayerRendererOnImplThread(CCCompletionEvent* completion, bool* initializeSucceeded, LayerRendererCapabilities* capabilities)
+void CCThreadProxy::initializeRendererOnImplThread(CCCompletionEvent* completion, bool* initializeSucceeded, RendererCapabilities* capabilities)
 {
-    TRACE_EVENT0("cc", "CCThreadProxy::initializeLayerRendererOnImplThread");
+    TRACE_EVENT0("cc", "CCThreadProxy::initializeRendererOnImplThread");
     ASSERT(isImplThread());
     ASSERT(m_contextBeforeInitializationOnImplThread);
-    *initializeSucceeded = m_layerTreeHostImpl->initializeLayerRenderer(m_contextBeforeInitializationOnImplThread.release(), textureUploader);
+    *initializeSucceeded = m_layerTreeHostImpl->initializeRenderer(m_contextBeforeInitializationOnImplThread.release(), textureUploader);
     if (*initializeSucceeded) {
-        *capabilities = m_layerTreeHostImpl->layerRendererCapabilities();
+        *capabilities = m_layerTreeHostImpl->rendererCapabilities();
         if (capabilities->usingSwapCompleteCallback)
             m_schedulerOnImplThread->setMaxFramesPending(2);
     }
@@ -888,14 +888,14 @@ size_t CCThreadProxy::maxPartialTextureUpdates() const
     return CCTextureUpdateController::maxPartialTextureUpdates();
 }
 
-void CCThreadProxy::recreateContextOnImplThread(CCCompletionEvent* completion, CCGraphicsContext* contextPtr, bool* recreateSucceeded, LayerRendererCapabilities* capabilities)
+void CCThreadProxy::recreateContextOnImplThread(CCCompletionEvent* completion, CCGraphicsContext* contextPtr, bool* recreateSucceeded, RendererCapabilities* capabilities)
 {
     TRACE_EVENT0("cc", "CCThreadProxy::recreateContextOnImplThread");
     ASSERT(isImplThread());
     m_layerTreeHost->deleteContentsTexturesOnImplThread(m_layerTreeHostImpl->resourceProvider());
-    *recreateSucceeded = m_layerTreeHostImpl->initializeLayerRenderer(adoptPtr(contextPtr), textureUploader);
+    *recreateSucceeded = m_layerTreeHostImpl->initializeRenderer(adoptPtr(contextPtr), textureUploader);
     if (*recreateSucceeded) {
-        *capabilities = m_layerTreeHostImpl->layerRendererCapabilities();
+        *capabilities = m_layerTreeHostImpl->rendererCapabilities();
         m_schedulerOnImplThread->didRecreateContext();
     }
     completion->signal();
index 91a9e4d..a240281 100644 (file)
@@ -57,11 +57,11 @@ public:
     virtual bool initializeContext() OVERRIDE;
     virtual void setSurfaceReady() OVERRIDE;
     virtual void setVisible(bool) OVERRIDE;
-    virtual bool initializeLayerRenderer() OVERRIDE;
+    virtual bool initializeRenderer() OVERRIDE;
     virtual bool recreateContext() OVERRIDE;
     virtual int compositorIdentifier() const OVERRIDE;
     virtual void implSideRenderingStats(CCRenderingStats&) OVERRIDE;
-    virtual const LayerRendererCapabilities& layerRendererCapabilities() const OVERRIDE;
+    virtual const RendererCapabilities& rendererCapabilities() const OVERRIDE;
     virtual void loseContext() OVERRIDE;
     virtual void setNeedsAnimate() OVERRIDE;
     virtual void setNeedsCommit() OVERRIDE;
@@ -136,11 +136,11 @@ private:
     void setSurfaceReadyOnImplThread();
     void setVisibleOnImplThread(CCCompletionEvent*, bool);
     void initializeContextOnImplThread(CCGraphicsContext*);
-    void initializeLayerRendererOnImplThread(CCCompletionEvent*, bool* initializeSucceeded, LayerRendererCapabilities*);
+    void initializeRendererOnImplThread(CCCompletionEvent*, bool* initializeSucceeded, RendererCapabilities*);
     void layerTreeHostClosedOnImplThread(CCCompletionEvent*);
     void setFullRootLayerDamageOnImplThread();
     void acquireLayerTexturesForMainThreadOnImplThread(CCCompletionEvent*);
-    void recreateContextOnImplThread(CCCompletionEvent*, CCGraphicsContext*, bool* recreateSucceeded, LayerRendererCapabilities*);
+    void recreateContextOnImplThread(CCCompletionEvent*, CCGraphicsContext*, bool* recreateSucceeded, RendererCapabilities*);
     void implSideRenderingStatsOnImplThread(CCCompletionEvent*, CCRenderingStats*);
     CCScheduledActionDrawAndSwapResult scheduledActionDrawAndSwapInternal(bool forcedDraw);
     void forceSerializeOnSwapBuffersOnImplThread(CCCompletionEvent*);
@@ -153,8 +153,8 @@ private:
     OwnPtr<CCThreadProxyContextRecreationTimer> m_contextRecreationTimer;
     CCLayerTreeHost* m_layerTreeHost;
     int m_compositorIdentifier;
-    bool m_layerRendererInitialized;
-    LayerRendererCapabilities m_layerRendererCapabilitiesMainThreadCopy;
+    bool m_rendererInitialized;
+    RendererCapabilities m_RendererCapabilitiesMainThreadCopy;
     bool m_started;
     bool m_texturesAcquired;
     bool m_inCompositeAndReadback;
@@ -168,7 +168,7 @@ private:
     RefPtr<CCScopedThreadProxy> m_mainThreadProxy;
 
     // Holds on to the context we might use for compositing in between initializeContext()
-    // and initializeLayerRenderer() calls.
+    // and initializeRenderer() calls.
     OwnPtr<CCGraphicsContext> m_contextBeforeInitializationOnImplThread;
 
     // Set when the main thread is waiting on a scheduledActionBeginFrame to be issued.
index 022581b..8c1e605 100644 (file)
@@ -1,3 +1,92 @@
+2012-08-23  Alexandre Elias  <aelias@chromium.org>
+
+        [chromium] Rename LayerRendererChromium to GL-specific name
+        https://bugs.webkit.org/show_bug.cgi?id=94835
+
+        Reviewed by James Robinson.
+
+        Over time, LayerRendererChromium has evolved to be a GL-specific
+        subclass of CCRenderer that has no awareness of layers (as it operates
+        only with drawQuads).
+
+        This patch renames LayerRendererChromium to CCRendererGL, replaces all
+        instances of "layerRenderer" with just "renderer", and removes a
+        few unnecessary includes of LayerRendererChromium.h.
+
+        * WebKit.gypi:
+        * tests/CCLayerTreeHostImplTest.cpp:
+        * tests/CCLayerTreeHostTest.cpp:
+        (WTF::CCLayerTreeHostTestLayerOcclusion::beginTest):
+        (WTF::CCLayerTreeHostTestLayerOcclusionWithFilters::beginTest):
+        (WTF::CCLayerTreeHostTestManySurfaces::beginTest):
+        (WTF::CCLayerTreeHostTestSurfaceNotAllocatedForLayersOutsideMemoryLimit::drawLayersOnCCThread):
+        * tests/CCRendererGLTest.cpp: Renamed from Source/WebKit/chromium/tests/LayerRendererChromiumTest.cpp.
+        (FrameCountingMemoryAllocationSettingContext):
+        (FrameCountingMemoryAllocationSettingContext::FrameCountingMemoryAllocationSettingContext):
+        (FrameCountingMemoryAllocationSettingContext::prepareTexture):
+        (FrameCountingMemoryAllocationSettingContext::setMemoryAllocationChangedCallbackCHROMIUM):
+        (FrameCountingMemoryAllocationSettingContext::getString):
+        (FrameCountingMemoryAllocationSettingContext::frameCount):
+        (FrameCountingMemoryAllocationSettingContext::setMemoryAllocation):
+        (FakeCCRendererClient):
+        (FakeCCRendererClient::FakeCCRendererClient):
+        (FakeCCRendererClient::setFullRootLayerDamageCount):
+        (FakeCCRendererClient::rootRenderPass):
+        (FakeCCRendererClient::renderPassesInDrawOrder):
+        (FakeCCRendererClient::renderPasses):
+        (FakeCCRendererClient::memoryAllocationLimitBytes):
+        (FakeCCRendererGL):
+        (FakeCCRendererGL::FakeCCRendererGL):
+        (CCRendererGLTest):
+        (CCRendererGLTest::CCRendererGLTest):
+        (CCRendererGLTest::SetUp):
+        (CCRendererGLTest::TearDown):
+        (CCRendererGLTest::swapBuffers):
+        (CCRendererGLTest::context):
+        (TEST_F):
+        (ForbidSynchronousCallContext):
+        (ForbidSynchronousCallContext::ForbidSynchronousCallContext):
+        (ForbidSynchronousCallContext::getActiveAttrib):
+        (ForbidSynchronousCallContext::getActiveUniform):
+        (ForbidSynchronousCallContext::getAttachedShaders):
+        (ForbidSynchronousCallContext::getAttribLocation):
+        (ForbidSynchronousCallContext::getBooleanv):
+        (ForbidSynchronousCallContext::getBufferParameteriv):
+        (ForbidSynchronousCallContext::getContextAttributes):
+        (ForbidSynchronousCallContext::getError):
+        (ForbidSynchronousCallContext::getFloatv):
+        (ForbidSynchronousCallContext::getFramebufferAttachmentParameteriv):
+        (ForbidSynchronousCallContext::getIntegerv):
+        (ForbidSynchronousCallContext::getProgramiv):
+        (ForbidSynchronousCallContext::getShaderiv):
+        (ForbidSynchronousCallContext::getString):
+        (ForbidSynchronousCallContext::getProgramInfoLog):
+        (ForbidSynchronousCallContext::getRenderbufferParameteriv):
+        (ForbidSynchronousCallContext::getShaderInfoLog):
+        (ForbidSynchronousCallContext::getShaderPrecisionFormat):
+        (ForbidSynchronousCallContext::getShaderSource):
+        (ForbidSynchronousCallContext::getTexParameterfv):
+        (ForbidSynchronousCallContext::getTexParameteriv):
+        (ForbidSynchronousCallContext::getUniformfv):
+        (ForbidSynchronousCallContext::getUniformiv):
+        (ForbidSynchronousCallContext::getUniformLocation):
+        (ForbidSynchronousCallContext::getVertexAttribfv):
+        (ForbidSynchronousCallContext::getVertexAttribiv):
+        (ForbidSynchronousCallContext::getVertexAttribOffset):
+        (TEST):
+        (LoseContextOnFirstGetContext):
+        (LoseContextOnFirstGetContext::LoseContextOnFirstGetContext):
+        (ContextThatDoesNotSupportMemoryManagmentExtensions):
+        (ContextThatDoesNotSupportMemoryManagmentExtensions::ContextThatDoesNotSupportMemoryManagmentExtensions):
+        (ContextThatDoesNotSupportMemoryManagmentExtensions::prepareTexture):
+        (ContextThatDoesNotSupportMemoryManagmentExtensions::setMemoryAllocationChangedCallbackCHROMIUM):
+        (ContextThatDoesNotSupportMemoryManagmentExtensions::getString):
+        (ClearCountingContext):
+        (ClearCountingContext::ClearCountingContext):
+        (ClearCountingContext::clear):
+        (ClearCountingContext::clearCount):
+        * tests/TiledLayerChromiumTest.cpp:
+
 2012-08-23  Stephen White  <senorblanco@chromium.org>
 
         Unreviewed.  Rolled DEPS.
index fc86f83..d28c26c 100644 (file)
             'tests/KeyboardTest.cpp',
             'tests/KURLTest.cpp',
             'tests/LayerChromiumTest.cpp',
-            'tests/LayerRendererChromiumTest.cpp',
+            'tests/CCRendererGLTest.cpp',
             'tests/LevelDBTest.cpp',
             'tests/LinkHighlightTest.cpp',
             'tests/ListenerLeakTest.cpp',
index 6ec0ce5..804b6b1 100644 (file)
@@ -35,6 +35,7 @@
 #include "CCLayerTreeTestCommon.h"
 #include "CCQuadCuller.h"
 #include "CCRenderPassDrawQuad.h"
+#include "CCRendererGL.h"
 #include "CCScrollbarLayerImpl.h"
 #include "CCSettings.h"
 #include "CCSingleThreadProxy.h"
@@ -47,7 +48,6 @@
 #include "FakeWebCompositorOutputSurface.h"
 #include "FakeWebGraphicsContext3D.h"
 #include "FakeWebScrollbarThemeGeometry.h"
-#include "LayerRendererChromium.h"
 #include <gmock/gmock.h>
 #include <gtest/gtest.h>
 #include <public/WebVideoFrame.h>
@@ -76,7 +76,7 @@ public:
         settings.minimumOcclusionTrackingSize = IntSize();
 
         m_hostImpl = CCLayerTreeHostImpl::create(settings, this);
-        m_hostImpl->initializeLayerRenderer(createContext(), UnthrottledUploader);
+        m_hostImpl->initializeRenderer(createContext(), UnthrottledUploader);
         m_hostImpl->setViewportSize(IntSize(10, 10), IntSize(10, 10));
     }
 
@@ -96,7 +96,7 @@ public:
 
         OwnPtr<CCLayerTreeHostImpl> myHostImpl = CCLayerTreeHostImpl::create(settings, this);
 
-        myHostImpl->initializeLayerRenderer(graphicsContext, UnthrottledUploader);
+        myHostImpl->initializeRenderer(graphicsContext, UnthrottledUploader);
         myHostImpl->setViewportSize(IntSize(10, 10), IntSize(10, 10));
 
         OwnPtr<CCLayerImpl> root = rootPtr;
@@ -165,9 +165,9 @@ public:
         return layer.release();
     }
 
-    void initializeLayerRendererAndDrawFrame()
+    void initializeRendererAndDrawFrame()
     {
-        m_hostImpl->initializeLayerRenderer(createContext(), UnthrottledUploader);
+        m_hostImpl->initializeRenderer(createContext(), UnthrottledUploader);
         CCLayerTreeHostImpl::FrameData frame;
         EXPECT_TRUE(m_hostImpl->prepareToDraw(frame));
         m_hostImpl->drawLayers(frame);
@@ -265,7 +265,7 @@ TEST_F(CCLayerTreeHostImplTest, scrollRootCallsCommitAndRedraw)
 {
     setupScrollAndContentsLayers(IntSize(100, 100));
     m_hostImpl->setViewportSize(IntSize(50, 50), IntSize(50, 50));
-    initializeLayerRendererAndDrawFrame();
+    initializeRendererAndDrawFrame();
 
     EXPECT_EQ(m_hostImpl->scrollBegin(IntPoint(0, 0), CCInputHandlerClient::Wheel), CCInputHandlerClient::ScrollStarted);
     m_hostImpl->scrollBy(IntPoint(), IntSize(0, 10));
@@ -286,7 +286,7 @@ TEST_F(CCLayerTreeHostImplTest, scrollWithoutRenderer)
     m_hostImpl = CCLayerTreeHostImpl::create(settings, this);
 
     // Initialization will fail here.
-    m_hostImpl->initializeLayerRenderer(FakeWebCompositorOutputSurface::create(adoptPtr(new FakeWebGraphicsContext3DMakeCurrentFails)), UnthrottledUploader);
+    m_hostImpl->initializeRenderer(FakeWebCompositorOutputSurface::create(adoptPtr(new FakeWebGraphicsContext3DMakeCurrentFails)), UnthrottledUploader);
     m_hostImpl->setViewportSize(IntSize(10, 10), IntSize(10, 10));
 
     setupScrollAndContentsLayers(IntSize(100, 100));
@@ -301,7 +301,7 @@ TEST_F(CCLayerTreeHostImplTest, replaceTreeWhileScrolling)
 
     setupScrollAndContentsLayers(IntSize(100, 100));
     m_hostImpl->setViewportSize(IntSize(50, 50), IntSize(50, 50));
-    initializeLayerRendererAndDrawFrame();
+    initializeRendererAndDrawFrame();
 
     // We should not crash if the tree is replaced while we are scrolling.
     EXPECT_EQ(m_hostImpl->scrollBegin(IntPoint(0, 0), CCInputHandlerClient::Wheel), CCInputHandlerClient::ScrollStarted);
@@ -321,7 +321,7 @@ TEST_F(CCLayerTreeHostImplTest, clearRootRenderSurfaceAndScroll)
 {
     setupScrollAndContentsLayers(IntSize(100, 100));
     m_hostImpl->setViewportSize(IntSize(50, 50), IntSize(50, 50));
-    initializeLayerRendererAndDrawFrame();
+    initializeRendererAndDrawFrame();
 
     // We should be able to scroll even if the root layer loses its render surface after the most
     // recent render.
@@ -333,7 +333,7 @@ TEST_F(CCLayerTreeHostImplTest, wheelEventHandlers)
 {
     setupScrollAndContentsLayers(IntSize(100, 100));
     m_hostImpl->setViewportSize(IntSize(50, 50), IntSize(50, 50));
-    initializeLayerRendererAndDrawFrame();
+    initializeRendererAndDrawFrame();
     CCLayerImpl* root = m_hostImpl->rootLayer();
 
     root->setHaveWheelEventHandlers(true);
@@ -349,7 +349,7 @@ TEST_F(CCLayerTreeHostImplTest, shouldScrollOnMainThread)
 {
     setupScrollAndContentsLayers(IntSize(100, 100));
     m_hostImpl->setViewportSize(IntSize(50, 50), IntSize(50, 50));
-    initializeLayerRendererAndDrawFrame();
+    initializeRendererAndDrawFrame();
     CCLayerImpl* root = m_hostImpl->rootLayer();
 
     root->setShouldScrollOnMainThread(true);
@@ -362,7 +362,7 @@ TEST_F(CCLayerTreeHostImplTest, nonFastScrollableRegionBasic)
 {
     setupScrollAndContentsLayers(IntSize(200, 200));
     m_hostImpl->setViewportSize(IntSize(100, 100), IntSize(100, 100));
-    initializeLayerRendererAndDrawFrame();
+    initializeRendererAndDrawFrame();
     CCLayerImpl* root = m_hostImpl->rootLayer();
 
     root->setNonFastScrollableRegion(IntRect(0, 0, 50, 50));
@@ -388,7 +388,7 @@ TEST_F(CCLayerTreeHostImplTest, nonFastScrollableRegionWithOffset)
 
     root->setNonFastScrollableRegion(IntRect(0, 0, 50, 50));
     root->setPosition(FloatPoint(-25, 0));
-    initializeLayerRendererAndDrawFrame();
+    initializeRendererAndDrawFrame();
 
     // This point would fall into the non-fast scrollable region except that we've moved the layer down by 25 pixels.
     EXPECT_EQ(m_hostImpl->scrollBegin(IntPoint(40, 10), CCInputHandlerClient::Wheel), CCInputHandlerClient::ScrollStarted);
@@ -403,7 +403,7 @@ TEST_F(CCLayerTreeHostImplTest, pinchGesture)
 {
     setupScrollAndContentsLayers(IntSize(100, 100));
     m_hostImpl->setViewportSize(IntSize(50, 50), IntSize(50, 50));
-    initializeLayerRendererAndDrawFrame();
+    initializeRendererAndDrawFrame();
 
     CCLayerImpl* scrollLayer = m_hostImpl->rootScrollLayer();
     ASSERT(scrollLayer);
@@ -484,7 +484,7 @@ TEST_F(CCLayerTreeHostImplTest, pageScaleAnimation)
 {
     setupScrollAndContentsLayers(IntSize(100, 100));
     m_hostImpl->setViewportSize(IntSize(50, 50), IntSize(50, 50));
-    initializeLayerRendererAndDrawFrame();
+    initializeRendererAndDrawFrame();
 
     CCLayerImpl* scrollLayer = m_hostImpl->rootScrollLayer();
     ASSERT(scrollLayer);
@@ -534,7 +534,7 @@ TEST_F(CCLayerTreeHostImplTest, inhibitScrollAndPageScaleUpdatesWhilePinchZoomin
 {
     setupScrollAndContentsLayers(IntSize(100, 100));
     m_hostImpl->setViewportSize(IntSize(50, 50), IntSize(50, 50));
-    initializeLayerRendererAndDrawFrame();
+    initializeRendererAndDrawFrame();
 
     CCLayerImpl* scrollLayer = m_hostImpl->rootScrollLayer();
     ASSERT(scrollLayer);
@@ -588,7 +588,7 @@ TEST_F(CCLayerTreeHostImplTest, inhibitScrollAndPageScaleUpdatesWhileAnimatingPa
 {
     setupScrollAndContentsLayers(IntSize(100, 100));
     m_hostImpl->setViewportSize(IntSize(50, 50), IntSize(50, 50));
-    initializeLayerRendererAndDrawFrame();
+    initializeRendererAndDrawFrame();
 
     CCLayerImpl* scrollLayer = m_hostImpl->rootScrollLayer();
     ASSERT(scrollLayer);
@@ -849,7 +849,7 @@ TEST_F(CCLayerTreeHostImplTest, scrollRootIgnored)
     OwnPtr<CCLayerImpl> root = CCLayerImpl::create(1);
     root->setScrollable(false);
     m_hostImpl->setRootLayer(root.release());
-    initializeLayerRendererAndDrawFrame();
+    initializeRendererAndDrawFrame();
 
     // Scroll event is ignored because layer is not scrollable.
     EXPECT_EQ(m_hostImpl->scrollBegin(IntPoint(0, 0), CCInputHandlerClient::Wheel), CCInputHandlerClient::ScrollIgnored);
@@ -882,7 +882,7 @@ TEST_F(CCLayerTreeHostImplTest, scrollNonCompositedRoot)
 
     m_hostImpl->setRootLayer(scrollLayer.release());
     m_hostImpl->setViewportSize(surfaceSize, surfaceSize);
-    initializeLayerRendererAndDrawFrame();
+    initializeRendererAndDrawFrame();
 
     EXPECT_EQ(m_hostImpl->scrollBegin(IntPoint(5, 5), CCInputHandlerClient::Wheel), CCInputHandlerClient::ScrollStarted);
     m_hostImpl->scrollBy(IntPoint(), IntSize(0, 10));
@@ -900,7 +900,7 @@ TEST_F(CCLayerTreeHostImplTest, scrollChildCallsCommitAndRedraw)
     root->addChild(createScrollableLayer(2, surfaceSize));
     m_hostImpl->setRootLayer(root.release());
     m_hostImpl->setViewportSize(surfaceSize, surfaceSize);
-    initializeLayerRendererAndDrawFrame();
+    initializeRendererAndDrawFrame();
 
     EXPECT_EQ(m_hostImpl->scrollBegin(IntPoint(5, 5), CCInputHandlerClient::Wheel), CCInputHandlerClient::ScrollStarted);
     m_hostImpl->scrollBy(IntPoint(), IntSize(0, 10));
@@ -916,7 +916,7 @@ TEST_F(CCLayerTreeHostImplTest, scrollMissesChild)
     root->addChild(createScrollableLayer(2, surfaceSize));
     m_hostImpl->setRootLayer(root.release());
     m_hostImpl->setViewportSize(surfaceSize, surfaceSize);
-    initializeLayerRendererAndDrawFrame();
+    initializeRendererAndDrawFrame();
 
     // Scroll event is ignored because the input coordinate is outside the layer boundaries.
     EXPECT_EQ(m_hostImpl->scrollBegin(IntPoint(15, 5), CCInputHandlerClient::Wheel), CCInputHandlerClient::ScrollIgnored);
@@ -938,7 +938,7 @@ TEST_F(CCLayerTreeHostImplTest, scrollMissesBackfacingChild)
 
     root->addChild(child.release());
     m_hostImpl->setRootLayer(root.release());
-    initializeLayerRendererAndDrawFrame();
+    initializeRendererAndDrawFrame();
 
     // Scroll event is ignored because the scrollable layer is not facing the viewer and there is
     // nothing scrollable behind it.
@@ -959,7 +959,7 @@ TEST_F(CCLayerTreeHostImplTest, scrollBlockedByContentLayer)
 
     m_hostImpl->setRootLayer(scrollLayer.release());
     m_hostImpl->setViewportSize(surfaceSize, surfaceSize);
-    initializeLayerRendererAndDrawFrame();
+    initializeRendererAndDrawFrame();
 
     // Scrolling fails because the content layer is asking to be scrolled on the main thread.
     EXPECT_EQ(m_hostImpl->scrollBegin(IntPoint(5, 5), CCInputHandlerClient::Wheel), CCInputHandlerClient::ScrollOnMainThread);
@@ -972,7 +972,7 @@ TEST_F(CCLayerTreeHostImplTest, scrollRootAndChangePageScaleOnMainThread)
     OwnPtr<CCLayerImpl> root = createScrollableLayer(1, surfaceSize);
     m_hostImpl->setRootLayer(root.release());
     m_hostImpl->setViewportSize(surfaceSize, surfaceSize);
-    initializeLayerRendererAndDrawFrame();
+    initializeRendererAndDrawFrame();
 
     IntSize scrollDelta(0, 10);
     IntSize expectedScrollDelta(scrollDelta);
@@ -1004,7 +1004,7 @@ TEST_F(CCLayerTreeHostImplTest, scrollRootAndChangePageScaleOnImplThread)
     m_hostImpl->setRootLayer(root.release());
     m_hostImpl->setViewportSize(surfaceSize, surfaceSize);
     m_hostImpl->setPageScaleFactorAndLimits(1, 1, pageScale);
-    initializeLayerRendererAndDrawFrame();
+    initializeRendererAndDrawFrame();
 
     IntSize scrollDelta(0, 10);
     IntSize expectedScrollDelta(scrollDelta);
@@ -1081,7 +1081,7 @@ TEST_F(CCLayerTreeHostImplTest, scrollChildAndChangePageScaleOnMainThread)
     root->addChild(createScrollableLayer(scrollLayerId, surfaceSize));
     m_hostImpl->setRootLayer(root.release());
     m_hostImpl->setViewportSize(surfaceSize, surfaceSize);
-    initializeLayerRendererAndDrawFrame();
+    initializeRendererAndDrawFrame();
 
     CCLayerImpl* child = m_hostImpl->rootLayer()->children()[0].get();
 
@@ -1125,7 +1125,7 @@ TEST_F(CCLayerTreeHostImplTest, scrollChildBeyondLimit)
     root->addChild(child.release());
     m_hostImpl->setRootLayer(root.release());
     m_hostImpl->setViewportSize(surfaceSize, surfaceSize);
-    initializeLayerRendererAndDrawFrame();
+    initializeRendererAndDrawFrame();
     {
         IntSize scrollDelta(-8, -7);
         EXPECT_EQ(m_hostImpl->scrollBegin(IntPoint(5, 5), CCInputHandlerClient::Wheel), CCInputHandlerClient::ScrollStarted);
@@ -1157,7 +1157,7 @@ TEST_F(CCLayerTreeHostImplTest, scrollEventBubbling)
 
     m_hostImpl->setRootLayer(root.release());
     m_hostImpl->setViewportSize(surfaceSize, surfaceSize);
-    initializeLayerRendererAndDrawFrame();
+    initializeRendererAndDrawFrame();
     {
         IntSize scrollDelta(0, 4);
         EXPECT_EQ(m_hostImpl->scrollBegin(IntPoint(5, 5), CCInputHandlerClient::Wheel), CCInputHandlerClient::ScrollStarted);
@@ -1179,7 +1179,7 @@ TEST_F(CCLayerTreeHostImplTest, scrollBeforeRedraw)
     m_hostImpl->setViewportSize(surfaceSize, surfaceSize);
 
     // Draw one frame and then immediately rebuild the layer tree to mimic a tree synchronization.
-    initializeLayerRendererAndDrawFrame();
+    initializeRendererAndDrawFrame();
     m_hostImpl->detachLayerTree();
     m_hostImpl->setRootLayer(createScrollableLayer(2, surfaceSize));
 
@@ -1198,7 +1198,7 @@ TEST_F(CCLayerTreeHostImplTest, scrollAxisAlignedRotatedLayer)
 
     IntSize surfaceSize(50, 50);
     m_hostImpl->setViewportSize(surfaceSize, surfaceSize);
-    initializeLayerRendererAndDrawFrame();
+    initializeRendererAndDrawFrame();
 
     // Scroll to the right in screen coordinates with a gesture.
     IntSize gestureScrollDelta(10, 0);
@@ -1242,7 +1242,7 @@ TEST_F(CCLayerTreeHostImplTest, scrollNonAxisAlignedRotatedLayer)
 
     IntSize surfaceSize(50, 50);
     m_hostImpl->setViewportSize(surfaceSize, surfaceSize);
-    initializeLayerRendererAndDrawFrame();
+    initializeRendererAndDrawFrame();
 
     {
         // Scroll down in screen coordinates with a gesture.
@@ -1295,7 +1295,7 @@ TEST_F(CCLayerTreeHostImplTest, scrollScaledLayer)
 
     IntSize surfaceSize(50, 50);
     m_hostImpl->setViewportSize(surfaceSize, surfaceSize);
-    initializeLayerRendererAndDrawFrame();
+    initializeRendererAndDrawFrame();
 
     // Scroll down in screen coordinates with a gesture.
     IntSize scrollDelta(0, 10);
@@ -1622,7 +1622,7 @@ TEST_F(CCLayerTreeHostImplTest, blendingOffWhenDrawingOpaqueLayers)
 
 TEST_F(CCLayerTreeHostImplTest, viewportCovered)
 {
-    m_hostImpl->initializeLayerRenderer(createContext(), UnthrottledUploader);
+    m_hostImpl->initializeRenderer(createContext(), UnthrottledUploader);
     m_hostImpl->setBackgroundColor(SK_ColorGRAY);
 
     IntSize viewportSize(1000, 1000);
@@ -1733,7 +1733,7 @@ TEST_F(CCLayerTreeHostImplTest, reshapeNotCalledUntilDraw)
 {
     OwnPtr<CCGraphicsContext> ccContext = FakeWebCompositorOutputSurface::create(adoptPtr(new ReshapeTrackerContext));
     ReshapeTrackerContext* reshapeTracker = static_cast<ReshapeTrackerContext*>(ccContext->context3D());
-    m_hostImpl->initializeLayerRenderer(ccContext.release(), UnthrottledUploader);
+    m_hostImpl->initializeRenderer(ccContext.release(), UnthrottledUploader);
 
     CCLayerImpl* root = new FakeDrawableCCLayerImpl(1);
     root->setAnchorPoint(FloatPoint(0, 0));
@@ -1782,7 +1782,7 @@ TEST_F(CCLayerTreeHostImplTest, partialSwapReceivesDamageRect)
     CCLayerTreeSettings settings;
     CCSettings::setPartialSwapEnabled(true);
     OwnPtr<CCLayerTreeHostImpl> layerTreeHostImpl = CCLayerTreeHostImpl::create(settings, this);
-    layerTreeHostImpl->initializeLayerRenderer(ccContext.release(), UnthrottledUploader);
+    layerTreeHostImpl->initializeRenderer(ccContext.release(), UnthrottledUploader);
     layerTreeHostImpl->setViewportSize(IntSize(500, 500), IntSize(500, 500));
 
     CCLayerImpl* root = new FakeDrawableCCLayerImpl(1);
@@ -2067,7 +2067,7 @@ static PassOwnPtr<CCLayerTreeHostImpl> setupLayersForOpacity(bool partialSwap, C
 
     CCLayerTreeSettings settings;
     OwnPtr<CCLayerTreeHostImpl> myHostImpl = CCLayerTreeHostImpl::create(settings, client);
-    myHostImpl->initializeLayerRenderer(context.release(), UnthrottledUploader);
+    myHostImpl->initializeRenderer(context.release(), UnthrottledUploader);
     myHostImpl->setViewportSize(IntSize(100, 100), IntSize(100, 100));
 
     /*
@@ -2206,7 +2206,7 @@ TEST_F(CCLayerTreeHostImplTest, contextLostAndRestoredNotificationSentToAllLayer
     EXPECT_FALSE(layer1->didLoseContextCalled());
     EXPECT_FALSE(layer2->didLoseContextCalled());
 
-    m_hostImpl->initializeLayerRenderer(createContext(), UnthrottledUploader);
+    m_hostImpl->initializeRenderer(createContext(), UnthrottledUploader);
 
     EXPECT_TRUE(root->didLoseContextCalled());
     EXPECT_TRUE(layer1->didLoseContextCalled());
@@ -2219,7 +2219,7 @@ TEST_F(CCLayerTreeHostImplTest, finishAllRenderingAfterContextLost)
     m_hostImpl = CCLayerTreeHostImpl::create(settings, this);
 
     // The context initialization will fail, but we should still be able to call finishAllRendering() without any ill effects.
-    m_hostImpl->initializeLayerRenderer(FakeWebCompositorOutputSurface::create(adoptPtr(new FakeWebGraphicsContext3DMakeCurrentFails)), UnthrottledUploader);
+    m_hostImpl->initializeRenderer(FakeWebCompositorOutputSurface::create(adoptPtr(new FakeWebGraphicsContext3DMakeCurrentFails)), UnthrottledUploader);
     m_hostImpl->finishAllRendering();
 }
 
@@ -2501,7 +2501,7 @@ TEST_F(CCLayerTreeHostImplTest, dontUseOldResourcesAfterLostContext)
     rootLayer->addChild(scrollbarLayer.release());
 
     // Use a context that supports IOSurfaces
-    m_hostImpl->initializeLayerRenderer(FakeWebCompositorOutputSurface::create(adoptPtr(new FakeWebGraphicsContext3DWithIOSurface)), UnthrottledUploader);
+    m_hostImpl->initializeRenderer(FakeWebCompositorOutputSurface::create(adoptPtr(new FakeWebGraphicsContext3DWithIOSurface)), UnthrottledUploader);
 
     hwVideoFrame.setTextureId(m_hostImpl->resourceProvider()->graphicsContext3D()->createTexture());
 
@@ -2517,7 +2517,7 @@ TEST_F(CCLayerTreeHostImplTest, dontUseOldResourcesAfterLostContext)
 
     // Lose the context, replacing it with a StrictWebGraphicsContext3DWithIOSurface,
     // that will warn if any resource from the previous context gets used.
-    m_hostImpl->initializeLayerRenderer(FakeWebCompositorOutputSurface::create(adoptPtr(new StrictWebGraphicsContext3DWithIOSurface)), UnthrottledUploader);
+    m_hostImpl->initializeRenderer(FakeWebCompositorOutputSurface::create(adoptPtr(new StrictWebGraphicsContext3DWithIOSurface)), UnthrottledUploader);
 
     // Create dummy resources so that looking up an old resource will get an
     // invalid texture id mapping.
@@ -2630,7 +2630,7 @@ TEST_F(CCLayerTreeHostImplTest, layersFreeTextures)
     // Lose the context, replacing it with a TrackingWebGraphicsContext3D (which the CCLayerTreeHostImpl takes ownership of).
     OwnPtr<CCGraphicsContext> ccContext(FakeWebCompositorOutputSurface::create(adoptPtr(new TrackingWebGraphicsContext3D)));
     TrackingWebGraphicsContext3D* trackingWebGraphicsContext = static_cast<TrackingWebGraphicsContext3D*>(ccContext->context3D());
-    m_hostImpl->initializeLayerRenderer(ccContext.release(), UnthrottledUploader);
+    m_hostImpl->initializeRenderer(ccContext.release(), UnthrottledUploader);
 
     m_hostImpl->setRootLayer(rootLayer.release());
 
@@ -2702,7 +2702,7 @@ static void setupLayersForTextureCaching(CCLayerTreeHostImpl* layerTreeHostImpl,
 {
     OwnPtr<CCGraphicsContext> context = FakeWebCompositorOutputSurface::create(adoptPtr(new PartialSwapContext));
 
-    layerTreeHostImpl->initializeLayerRenderer(context.release(), UnthrottledUploader);
+    layerTreeHostImpl->initializeRenderer(context.release(), UnthrottledUploader);
     layerTreeHostImpl->setViewportSize(rootSize, rootSize);
 
     OwnPtr<CCLayerImpl> root = CCLayerImpl::create(1);
@@ -2728,9 +2728,9 @@ static void setupLayersForTextureCaching(CCLayerTreeHostImpl* layerTreeHostImpl,
     addDrawingLayerTo(surfaceLayerPtr, 4, IntRect(5, 5, rootSize.width() - 25, rootSize.height() - 25), &childPtr);
 }
 
-class LayerRendererChromiumWithReleaseTextures : public LayerRendererChromium {
+class CCRendererGLWithReleaseTextures : public CCRendererGL {
 public:
-    using LayerRendererChromium::releaseRenderPassTextures;
+    using CCRendererGL::releaseRenderPassTextures;
 };
 
 TEST_F(CCLayerTreeHostImplTest, textureCachingWithClipping)
@@ -2748,7 +2748,7 @@ TEST_F(CCLayerTreeHostImplTest, textureCachingWithClipping)
 
     IntSize rootSize(100, 100);
 
-    myHostImpl->initializeLayerRenderer(context.release(), UnthrottledUploader);
+    myHostImpl->initializeRenderer(context.release(), UnthrottledUploader);
     myHostImpl->setViewportSize(IntSize(rootSize.width(), rootSize.height()), IntSize(rootSize.width(), rootSize.height()));
 
     OwnPtr<CCLayerImpl> root = CCLayerImpl::create(1);
@@ -2860,7 +2860,7 @@ TEST_F(CCLayerTreeHostImplTest, textureCachingWithOcclusion)
 
     IntSize rootSize(1000, 1000);
 
-    myHostImpl->initializeLayerRenderer(context.release(), UnthrottledUploader);
+    myHostImpl->initializeRenderer(context.release(), UnthrottledUploader);
     myHostImpl->setViewportSize(IntSize(rootSize.width(), rootSize.height()), IntSize(rootSize.width(), rootSize.height()));
 
     OwnPtr<CCLayerImpl> root = CCLayerImpl::create(1);
@@ -2973,7 +2973,7 @@ TEST_F(CCLayerTreeHostImplTest, textureCachingWithOcclusionEarlyOut)
 
     IntSize rootSize(1000, 1000);
 
-    myHostImpl->initializeLayerRenderer(context.release(), UnthrottledUploader);
+    myHostImpl->initializeRenderer(context.release(), UnthrottledUploader);
     myHostImpl->setViewportSize(IntSize(rootSize.width(), rootSize.height()), IntSize(rootSize.width(), rootSize.height()));
 
     OwnPtr<CCLayerImpl> root = CCLayerImpl::create(1);
@@ -3087,7 +3087,7 @@ TEST_F(CCLayerTreeHostImplTest, textureCachingWithOcclusionExternalOverInternal)
 
     IntSize rootSize(1000, 1000);
 
-    myHostImpl->initializeLayerRenderer(context.release(), UnthrottledUploader);
+    myHostImpl->initializeRenderer(context.release(), UnthrottledUploader);
     myHostImpl->setViewportSize(IntSize(rootSize.width(), rootSize.height()), IntSize(rootSize.width(), rootSize.height()));
 
     OwnPtr<CCLayerImpl> root = CCLayerImpl::create(1);
@@ -3170,7 +3170,7 @@ TEST_F(CCLayerTreeHostImplTest, textureCachingWithOcclusionExternalNotAligned)
 
     IntSize rootSize(1000, 1000);
 
-    myHostImpl->initializeLayerRenderer(context.release(), UnthrottledUploader);
+    myHostImpl->initializeRenderer(context.release(), UnthrottledUploader);
     myHostImpl->setViewportSize(IntSize(rootSize.width(), rootSize.height()), IntSize(rootSize.width(), rootSize.height()));
 
     OwnPtr<CCLayerImpl> root = CCLayerImpl::create(1);
@@ -3255,7 +3255,7 @@ TEST_F(CCLayerTreeHostImplTest, textureCachingWithOcclusionPartialSwap)
 
     IntSize rootSize(1000, 1000);
 
-    myHostImpl->initializeLayerRenderer(context.release(), UnthrottledUploader);
+    myHostImpl->initializeRenderer(context.release(), UnthrottledUploader);
     myHostImpl->setViewportSize(IntSize(rootSize.width(), rootSize.height()), IntSize(rootSize.width(), rootSize.height()));
 
     OwnPtr<CCLayerImpl> root = CCLayerImpl::create(1);
@@ -3373,7 +3373,7 @@ TEST_F(CCLayerTreeHostImplTest, textureCachingWithScissor)
     IntRect grandChildRect(5, 5, 150, 150);
 
     OwnPtr<CCGraphicsContext> context = FakeWebCompositorOutputSurface::create(adoptPtr(new PartialSwapContext));
-    myHostImpl->initializeLayerRenderer(context.release(), UnthrottledUploader);
+    myHostImpl->initializeRenderer(context.release(), UnthrottledUploader);
 
     root->setAnchorPoint(FloatPoint(0, 0));
     root->setPosition(FloatPoint(rootRect.x(), rootRect.y()));
@@ -3408,7 +3408,7 @@ TEST_F(CCLayerTreeHostImplTest, textureCachingWithScissor)
     myHostImpl->setRootLayer(root.release());
     myHostImpl->setViewportSize(rootRect.size(), rootRect.size());
 
-    EXPECT_FALSE(myHostImpl->layerRenderer()->haveCachedResourcesForRenderPassId(childPtr->id()));
+    EXPECT_FALSE(myHostImpl->renderer()->haveCachedResourcesForRenderPassId(childPtr->id()));
 
     {
         CCLayerTreeHostImpl::FrameData frame;
@@ -3418,7 +3418,7 @@ TEST_F(CCLayerTreeHostImplTest, textureCachingWithScissor)
     }
 
     // We should have cached textures for surface 2.
-    EXPECT_TRUE(myHostImpl->layerRenderer()->haveCachedResourcesForRenderPassId(childPtr->id()));
+    EXPECT_TRUE(myHostImpl->renderer()->haveCachedResourcesForRenderPassId(childPtr->id()));
 
     {
         CCLayerTreeHostImpl::FrameData frame;
@@ -3428,7 +3428,7 @@ TEST_F(CCLayerTreeHostImplTest, textureCachingWithScissor)
     }
 
     // We should still have cached textures for surface 2 after drawing with no damage.
-    EXPECT_TRUE(myHostImpl->layerRenderer()->haveCachedResourcesForRenderPassId(childPtr->id()));
+    EXPECT_TRUE(myHostImpl->renderer()->haveCachedResourcesForRenderPassId(childPtr->id()));
 
     // Damage a single tile of surface 2.
     childPtr->setUpdateRect(IntRect(10, 10, 10, 10));
@@ -3441,7 +3441,7 @@ TEST_F(CCLayerTreeHostImplTest, textureCachingWithScissor)
     }
 
     // We should have a cached texture for surface 2 again even though it was damaged.
-    EXPECT_TRUE(myHostImpl->layerRenderer()->haveCachedResourcesForRenderPassId(childPtr->id()));
+    EXPECT_TRUE(myHostImpl->renderer()->haveCachedResourcesForRenderPassId(childPtr->id()));
 }
 
 TEST_F(CCLayerTreeHostImplTest, surfaceTextureCaching)
@@ -3537,7 +3537,7 @@ TEST_F(CCLayerTreeHostImplTest, surfaceTextureCaching)
 
     // Change opacity again, and evict the cached surface texture.
     surfaceLayerPtr->setOpacity(0.5f);
-    static_cast<LayerRendererChromiumWithReleaseTextures*>(myHostImpl->layerRenderer())->releaseRenderPassTextures();
+    static_cast<CCRendererGLWithReleaseTextures*>(myHostImpl->renderer())->releaseRenderPassTextures();
 
     // Change opacity and draw
     surfaceLayerPtr->setOpacity(0.6f);
@@ -3559,7 +3559,7 @@ TEST_F(CCLayerTreeHostImplTest, surfaceTextureCaching)
         EXPECT_TRUE(targetPass->damageRect().isEmpty());
 
         // Was our surface evicted?
-        EXPECT_FALSE(myHostImpl->layerRenderer()->haveCachedResourcesForRenderPassId(targetPass->id()));
+        EXPECT_FALSE(myHostImpl->renderer()->haveCachedResourcesForRenderPassId(targetPass->id()));
 
         myHostImpl->drawLayers(frame);
         myHostImpl->didDrawAllLayers(frame);
@@ -3703,7 +3703,7 @@ TEST_F(CCLayerTreeHostImplTest, surfaceTextureCachingNoPartialSwap)
 
     // Change opacity again, and evict the cached surface texture.
     surfaceLayerPtr->setOpacity(0.5f);
-    static_cast<LayerRendererChromiumWithReleaseTextures*>(myHostImpl->layerRenderer())->releaseRenderPassTextures();
+    static_cast<CCRendererGLWithReleaseTextures*>(myHostImpl->renderer())->releaseRenderPassTextures();
 
     // Change opacity and draw
     surfaceLayerPtr->setOpacity(0.6f);
@@ -3725,7 +3725,7 @@ TEST_F(CCLayerTreeHostImplTest, surfaceTextureCachingNoPartialSwap)
         EXPECT_TRUE(targetPass->damageRect().isEmpty());
 
         // Was our surface evicted?
-        EXPECT_FALSE(myHostImpl->layerRenderer()->haveCachedResourcesForRenderPassId(targetPass->id()));
+        EXPECT_FALSE(myHostImpl->renderer()->haveCachedResourcesForRenderPassId(targetPass->id()));
 
         myHostImpl->drawLayers(frame);
         myHostImpl->didDrawAllLayers(frame);
@@ -3819,7 +3819,7 @@ protected:
     CCTestRenderPass(CCRenderSurface* renderSurface, int id) : CCRenderPass(renderSurface, id) { }
 };
 
-class CCTestRenderer : public LayerRendererChromium, public CCRendererClient {
+class CCTestRenderer : public CCRendererGL, public CCRendererClient {
 public:
     static PassOwnPtr<CCTestRenderer> create(CCResourceProvider* resourceProvider)
     {
@@ -3845,7 +3845,7 @@ public:
     virtual void setMemoryAllocationLimitBytes(size_t) OVERRIDE { }
 
 protected:
-    CCTestRenderer(CCResourceProvider* resourceProvider) : LayerRendererChromium(this, resourceProvider, UnthrottledUploader) { }
+    CCTestRenderer(CCResourceProvider* resourceProvider) : CCRendererGL(this, resourceProvider, UnthrottledUploader) { }
 
 private:
     CCLayerTreeSettings m_settings;
index 5202208..fd71873 100644 (file)
@@ -1625,7 +1625,7 @@ public:
 
         m_layerTreeHost->setRootLayer(rootLayer);
         m_layerTreeHost->setViewportSize(rootLayer->bounds(), rootLayer->bounds());
-        ASSERT_TRUE(m_layerTreeHost->initializeLayerRendererIfNeeded());
+        ASSERT_TRUE(m_layerTreeHost->initializeRendererIfNeeded());
         CCTextureUpdateQueue queue;
         m_layerTreeHost->updateLayers(queue, std::numeric_limits<size_t>::max());
         m_layerTreeHost->commitComplete();
@@ -1833,7 +1833,7 @@ public:
 
         m_layerTreeHost->setRootLayer(rootLayer);
         m_layerTreeHost->setViewportSize(rootLayer->bounds(), rootLayer->bounds());
-        ASSERT_TRUE(m_layerTreeHost->initializeLayerRendererIfNeeded());
+        ASSERT_TRUE(m_layerTreeHost->initializeRendererIfNeeded());
         CCTextureUpdateQueue queue;
         m_layerTreeHost->updateLayers(queue, std::numeric_limits<size_t>::max());
         m_layerTreeHost->commitComplete();
@@ -1922,7 +1922,7 @@ public:
 
         m_layerTreeHost->setRootLayer(layers[0].get());
         m_layerTreeHost->setViewportSize(layers[0]->bounds(), layers[0]->bounds());
-        ASSERT_TRUE(m_layerTreeHost->initializeLayerRendererIfNeeded());
+        ASSERT_TRUE(m_layerTreeHost->initializeRendererIfNeeded());
         CCTextureUpdateQueue queue;
         m_layerTreeHost->updateLayers(queue, std::numeric_limits<size_t>::max());
         m_layerTreeHost->commitComplete();
@@ -2300,7 +2300,7 @@ public:
 
     virtual void drawLayersOnCCThread(CCLayerTreeHostImpl* hostImpl)
     {
-        CCRenderer* renderer = hostImpl->layerRenderer();
+        CCRenderer* renderer = hostImpl->renderer();
         unsigned surface1RenderPassId = hostImpl->rootLayer()->children()[0]->id();
         unsigned surface2RenderPassId = hostImpl->rootLayer()->children()[0]->children()[0]->id();
 
@@ -23,7 +23,7 @@
  */
 
 #include "config.h"
-#include "LayerRendererChromium.h"
+#include "CCRendererGL.h"
 
 #include "CCDrawQuad.h"
 #include "CCPrioritizedTextureManager.h"
@@ -112,32 +112,32 @@ private:
     size_t m_memoryAllocationLimitBytes;
 };
 
-class FakeLayerRendererChromium : public LayerRendererChromium {
+class FakeCCRendererGL : public CCRendererGL {
 public:
-    FakeLayerRendererChromium(CCRendererClient* client, CCResourceProvider* resourceProvider) : LayerRendererChromium(client, resourceProvider, UnthrottledUploader) { }
+    FakeCCRendererGL(CCRendererClient* client, CCResourceProvider* resourceProvider) : CCRendererGL(client, resourceProvider, UnthrottledUploader) { }
 
-    // LayerRendererChromium methods.
+    // CCRendererGL methods.
 
     // Changing visibility to public.
-    using LayerRendererChromium::initialize;
-    using LayerRendererChromium::isFramebufferDiscarded;
+    using CCRendererGL::initialize;
+    using CCRendererGL::isFramebufferDiscarded;
 };
 
-class LayerRendererChromiumTest : public testing::Test {
+class CCRendererGLTest : public testing::Test {
 protected:
-    LayerRendererChromiumTest()
+    CCRendererGLTest()
         : m_suggestHaveBackbufferYes(1, true)
         , m_suggestHaveBackbufferNo(1, false)
         , m_context(FakeWebCompositorOutputSurface::create(adoptPtr(new FrameCountingMemoryAllocationSettingContext())))
         , m_resourceProvider(CCResourceProvider::create(m_context.get()))
-        , m_layerRendererChromium(&m_mockClient, m_resourceProvider.get())
+        , m_renderer(&m_mockClient, m_resourceProvider.get())
     {
     }
 
     virtual void SetUp()
     {
         WebKit::WebCompositor::initialize(0);
-        m_layerRendererChromium.initialize();
+        m_renderer.initialize();
     }
 
     virtual void TearDown()
@@ -147,7 +147,7 @@ protected:
 
     void swapBuffers()
     {
-        m_layerRendererChromium.swapBuffers();
+        m_renderer.swapBuffers();
     }
 
     FrameCountingMemoryAllocationSettingContext* context() { return static_cast<FrameCountingMemoryAllocationSettingContext*>(m_context->context3D()); }
@@ -158,92 +158,92 @@ protected:
     OwnPtr<CCGraphicsContext> m_context;
     FakeCCRendererClient m_mockClient;
     OwnPtr<CCResourceProvider> m_resourceProvider;
-    FakeLayerRendererChromium m_layerRendererChromium;
+    FakeCCRendererGL m_renderer;
     CCScopedSettings m_scopedSettings;
 };
 
-// Test LayerRendererChromium discardFramebuffer functionality:
+// Test CCRendererGL discardFramebuffer functionality:
 // Suggest recreating framebuffer when one already exists.
 // Expected: it does nothing.
-TEST_F(LayerRendererChromiumTest, SuggestBackbufferYesWhenItAlreadyExistsShouldDoNothing)
+TEST_F(CCRendererGLTest, SuggestBackbufferYesWhenItAlreadyExistsShouldDoNothing)
 {
     context()->setMemoryAllocation(m_suggestHaveBackbufferYes);
     EXPECT_EQ(0, m_mockClient.setFullRootLayerDamageCount());
-    EXPECT_FALSE(m_layerRendererChromium.isFramebufferDiscarded());
+    EXPECT_FALSE(m_renderer.isFramebufferDiscarded());
 
     swapBuffers();
     EXPECT_EQ(1, context()->frameCount());
 }
 
-// Test LayerRendererChromium discardFramebuffer functionality:
+// Test CCRendererGL discardFramebuffer functionality:
 // Suggest discarding framebuffer when one exists and the renderer is not visible.
 // Expected: it is discarded and damage tracker is reset.
-TEST_F(LayerRendererChromiumTest, SuggestBackbufferNoShouldDiscardBackbufferAndDamageRootLayerWhileNotVisible)
+TEST_F(CCRendererGLTest, SuggestBackbufferNoShouldDiscardBackbufferAndDamageRootLayerWhileNotVisible)
 {
-    m_layerRendererChromium.setVisible(false);
+    m_renderer.setVisible(false);
     context()->setMemoryAllocation(m_suggestHaveBackbufferNo);
     EXPECT_EQ(1, m_mockClient.setFullRootLayerDamageCount());
-    EXPECT_TRUE(m_layerRendererChromium.isFramebufferDiscarded());
+    EXPECT_TRUE(m_renderer.isFramebufferDiscarded());
 }
 
-// Test LayerRendererChromium discardFramebuffer functionality:
+// Test CCRendererGL discardFramebuffer functionality:
 // Suggest discarding framebuffer when one exists and the renderer is visible.
 // Expected: the allocation is ignored.
-TEST_F(LayerRendererChromiumTest, SuggestBackbufferNoDoNothingWhenVisible)
+TEST_F(CCRendererGLTest, SuggestBackbufferNoDoNothingWhenVisible)
 {
-    m_layerRendererChromium.setVisible(true);
+    m_renderer.setVisible(true);
     context()->setMemoryAllocation(m_suggestHaveBackbufferNo);
     EXPECT_EQ(0, m_mockClient.setFullRootLayerDamageCount());
-    EXPECT_FALSE(m_layerRendererChromium.isFramebufferDiscarded());
+    EXPECT_FALSE(m_renderer.isFramebufferDiscarded());
 }
 
 
-// Test LayerRendererChromium discardFramebuffer functionality:
+// Test CCRendererGL discardFramebuffer functionality:
 // Suggest discarding framebuffer when one does not exist.
 // Expected: it does nothing.
-TEST_F(LayerRendererChromiumTest, SuggestBackbufferNoWhenItDoesntExistShouldDoNothing)
+TEST_F(CCRendererGLTest, SuggestBackbufferNoWhenItDoesntExistShouldDoNothing)
 {
-    m_layerRendererChromium.setVisible(false);
+    m_renderer.setVisible(false);
     context()->setMemoryAllocation(m_suggestHaveBackbufferNo);
     EXPECT_EQ(1, m_mockClient.setFullRootLayerDamageCount());
-    EXPECT_TRUE(m_layerRendererChromium.isFramebufferDiscarded());
+    EXPECT_TRUE(m_renderer.isFramebufferDiscarded());
 
     context()->setMemoryAllocation(m_suggestHaveBackbufferNo);
     EXPECT_EQ(1, m_mockClient.setFullRootLayerDamageCount());
-    EXPECT_TRUE(m_layerRendererChromium.isFramebufferDiscarded());
+    EXPECT_TRUE(m_renderer.isFramebufferDiscarded());
 }
 
-// Test LayerRendererChromium discardFramebuffer functionality:
+// Test CCRendererGL discardFramebuffer functionality:
 // Begin drawing a frame while a framebuffer is discarded.
 // Expected: will recreate framebuffer.
-TEST_F(LayerRendererChromiumTest, DiscardedBackbufferIsRecreatedForScopeDuration)
+TEST_F(CCRendererGLTest, DiscardedBackbufferIsRecreatedForScopeDuration)
 {
-    m_layerRendererChromium.setVisible(false);
+    m_renderer.setVisible(false);
     context()->setMemoryAllocation(m_suggestHaveBackbufferNo);
-    EXPECT_TRUE(m_layerRendererChromium.isFramebufferDiscarded());
+    EXPECT_TRUE(m_renderer.isFramebufferDiscarded());
     EXPECT_EQ(1, m_mockClient.setFullRootLayerDamageCount());
 
-    m_layerRendererChromium.setVisible(true);
-    m_layerRendererChromium.drawFrame(m_mockClient.renderPassesInDrawOrder(), m_mockClient.renderPasses());
-    EXPECT_FALSE(m_layerRendererChromium.isFramebufferDiscarded());
+    m_renderer.setVisible(true);
+    m_renderer.drawFrame(m_mockClient.renderPassesInDrawOrder(), m_mockClient.renderPasses());
+    EXPECT_FALSE(m_renderer.isFramebufferDiscarded());
 
     swapBuffers();
     EXPECT_EQ(1, context()->frameCount());
 }
 
-TEST_F(LayerRendererChromiumTest, FramebufferDiscardedAfterReadbackWhenNotVisible)
+TEST_F(CCRendererGLTest, FramebufferDiscardedAfterReadbackWhenNotVisible)
 {
-    m_layerRendererChromium.setVisible(false);
+    m_renderer.setVisible(false);
     context()->setMemoryAllocation(m_suggestHaveBackbufferNo);
-    EXPECT_TRUE(m_layerRendererChromium.isFramebufferDiscarded());
+    EXPECT_TRUE(m_renderer.isFramebufferDiscarded());
     EXPECT_EQ(1, m_mockClient.setFullRootLayerDamageCount());
 
     char pixels[4];
-    m_layerRendererChromium.drawFrame(m_mockClient.renderPassesInDrawOrder(), m_mockClient.renderPasses());
-    EXPECT_FALSE(m_layerRendererChromium.isFramebufferDiscarded());
+    m_renderer.drawFrame(m_mockClient.renderPassesInDrawOrder(), m_mockClient.renderPasses());
+    EXPECT_FALSE(m_renderer.isFramebufferDiscarded());
 
-    m_layerRendererChromium.getFramebufferPixels(pixels, IntRect(0, 0, 1, 1));
-    EXPECT_TRUE(m_layerRendererChromium.isFramebufferDiscarded());
+    m_renderer.getFramebufferPixels(pixels, IntRect(0, 0, 1, 1));
+    EXPECT_TRUE(m_renderer.isFramebufferDiscarded());
     EXPECT_EQ(2, m_mockClient.setFullRootLayerDamageCount());
 }
 
@@ -313,16 +313,16 @@ public:
     virtual WGC3Dsizeiptr getVertexAttribOffset(WGC3Duint index, WGC3Denum pname) { ADD_FAILURE(); return 0; }
 };
 
-// This test isn't using the same fixture as LayerRendererChromiumTest, and you can't mix TEST() and TEST_F() with the same name, hence LRC2.
-TEST(LayerRendererChromiumTest2, initializationDoesNotMakeSynchronousCalls)
+// This test isn't using the same fixture as CCRendererGLTest, and you can't mix TEST() and TEST_F() with the same name, hence LRC2.
+TEST(CCRendererGLTest2, initializationDoesNotMakeSynchronousCalls)
 {
     CCScopedSettings scopedSettings;
     FakeCCRendererClient mockClient;
     OwnPtr<CCGraphicsContext> context(FakeWebCompositorOutputSurface::create(adoptPtr(new ForbidSynchronousCallContext)));
     OwnPtr<CCResourceProvider> resourceProvider(CCResourceProvider::create(context.get()));
-    FakeLayerRendererChromium layerRendererChromium(&mockClient, resourceProvider.get());
+    FakeCCRendererGL renderer(&mockClient, resourceProvider.get());
 
-    EXPECT_TRUE(layerRendererChromium.initialize());
+    EXPECT_TRUE(renderer.initialize());
 }
 
 class LoseContextOnFirstGetContext : public FakeWebGraphicsContext3D {
@@ -358,15 +358,15 @@ private:
     bool m_contextLost;
 };
 
-TEST(LayerRendererChromiumTest2, initializationWithQuicklyLostContextDoesNotAssert)
+TEST(CCRendererGLTest2, initializationWithQuicklyLostContextDoesNotAssert)
 {
     CCScopedSettings scopedSettings;
     FakeCCRendererClient mockClient;
     OwnPtr<CCGraphicsContext> context(FakeWebCompositorOutputSurface::create(adoptPtr(new LoseContextOnFirstGetContext)));
     OwnPtr<CCResourceProvider> resourceProvider(CCResourceProvider::create(context.get()));
-    FakeLayerRendererChromium layerRendererChromium(&mockClient, resourceProvider.get());
+    FakeCCRendererGL renderer(&mockClient, resourceProvider.get());
 
-    layerRendererChromium.initialize();
+    renderer.initialize();
 }
 
 class ContextThatDoesNotSupportMemoryManagmentExtensions : public FakeWebGraphicsContext3D {
@@ -381,14 +381,14 @@ public:
     virtual WebString getString(WebKit::WGC3Denum name) { return WebString(); }
 };
 
-TEST(LayerRendererChromiumTest2, initializationWithoutGpuMemoryManagerExtensionSupportShouldDefaultToNonZeroAllocation)
+TEST(CCRendererGLTest2, initializationWithoutGpuMemoryManagerExtensionSupportShouldDefaultToNonZeroAllocation)
 {
     FakeCCRendererClient mockClient;
     OwnPtr<CCGraphicsContext> context(FakeWebCompositorOutputSurface::create(adoptPtr(new ContextThatDoesNotSupportMemoryManagmentExtensions)));
     OwnPtr<CCResourceProvider> resourceProvider(CCResourceProvider::create(context.get()));
-    FakeLayerRendererChromium layerRendererChromium(&mockClient, resourceProvider.get());
+    FakeCCRendererGL renderer(&mockClient, resourceProvider.get());
 
-    layerRendererChromium.initialize();
+    renderer.initialize();
 
     EXPECT_GT(mockClient.memoryAllocationLimitBytes(), 0ul);
 }
@@ -408,19 +408,19 @@ private:
     int m_clear;
 };
 
-TEST(LayerRendererChromiumTest2, opaqueBackground)
+TEST(CCRendererGLTest2, opaqueBackground)
 {
     FakeCCRendererClient mockClient;
     OwnPtr<CCGraphicsContext> ccContext(FakeWebCompositorOutputSurface::create(adoptPtr(new ClearCountingContext)));
     ClearCountingContext* context = static_cast<ClearCountingContext*>(ccContext->context3D());
     OwnPtr<CCResourceProvider> resourceProvider(CCResourceProvider::create(ccContext.get()));
-    FakeLayerRendererChromium layerRendererChromium(&mockClient, resourceProvider.get());
+    FakeCCRendererGL renderer(&mockClient, resourceProvider.get());
 
     mockClient.rootRenderPass()->setHasTransparentBackground(false);
 
-    EXPECT_TRUE(layerRendererChromium.initialize());
+    EXPECT_TRUE(renderer.initialize());
 
-    layerRendererChromium.drawFrame(mockClient.renderPassesInDrawOrder(), mockClient.renderPasses());
+    renderer.drawFrame(mockClient.renderPassesInDrawOrder(), mockClient.renderPasses());
 
     // On DEBUG builds, render passes with opaque background clear to blue to
     // easily see regions that were not drawn on the screen.
@@ -431,19 +431,19 @@ TEST(LayerRendererChromiumTest2, opaqueBackground)
 #endif
 }
 
-TEST(LayerRendererChromiumTest2, transparentBackground)
+TEST(CCRendererGLTest2, transparentBackground)
 {
     FakeCCRendererClient mockClient;
     OwnPtr<CCGraphicsContext> ccContext(FakeWebCompositorOutputSurface::create(adoptPtr(new ClearCountingContext)));
     ClearCountingContext* context = static_cast<ClearCountingContext*>(ccContext->context3D());
     OwnPtr<CCResourceProvider> resourceProvider(CCResourceProvider::create(ccContext.get()));
-    FakeLayerRendererChromium layerRendererChromium(&mockClient, resourceProvider.get());
+    FakeCCRendererGL renderer(&mockClient, resourceProvider.get());
 
     mockClient.rootRenderPass()->setHasTransparentBackground(true);
 
-    EXPECT_TRUE(layerRendererChromium.initialize());
+    EXPECT_TRUE(renderer.initialize());
 
-    layerRendererChromium.drawFrame(mockClient.renderPassesInDrawOrder(), mockClient.renderPasses());
+    renderer.drawFrame(mockClient.renderPassesInDrawOrder(), mockClient.renderPasses());
 
     EXPECT_EQ(1, context->clearCount());
 }
index 2efb8e5..00ee28a 100644 (file)
@@ -705,7 +705,7 @@ TEST_F(TiledLayerChromiumTest, skipsDrawGetsReset)
     WebKit::WebCompositor::initialize(0);
     FakeCCLayerTreeHostClient fakeCCLayerTreeHostClient;
     OwnPtr<CCLayerTreeHost> ccLayerTreeHost = CCLayerTreeHost::create(&fakeCCLayerTreeHostClient, CCLayerTreeSettings());
-    ASSERT_TRUE(ccLayerTreeHost->initializeLayerRendererIfNeeded());
+    ASSERT_TRUE(ccLayerTreeHost->initializeRendererIfNeeded());
 
     // Create two 300 x 300 tiled layers.
     IntSize contentBounds(300, 300);
@@ -791,7 +791,7 @@ TEST_F(TiledLayerChromiumTest, partialUpdates)
 
     FakeCCLayerTreeHostClient fakeCCLayerTreeHostClient;
     OwnPtr<CCLayerTreeHost> ccLayerTreeHost = CCLayerTreeHost::create(&fakeCCLayerTreeHostClient, settings);
-    ASSERT_TRUE(ccLayerTreeHost->initializeLayerRendererIfNeeded());
+    ASSERT_TRUE(ccLayerTreeHost->initializeRendererIfNeeded());
 
     // Create one 300 x 200 tiled layer with 3 x 2 tiles.
     IntSize contentBounds(300, 200);
@@ -1333,7 +1333,7 @@ TEST_F(TiledLayerChromiumTest, dontAllocateContentsWhenTargetSurfaceCantBeAlloca
     CCLayerTreeSettings settings;
     FakeCCLayerTreeHostClient fakeCCLayerTreeHostClient;
     OwnPtr<CCLayerTreeHost> ccLayerTreeHost = CCLayerTreeHost::create(&fakeCCLayerTreeHostClient, settings);
-    ASSERT_TRUE(ccLayerTreeHost->initializeLayerRendererIfNeeded());
+    ASSERT_TRUE(ccLayerTreeHost->initializeRendererIfNeeded());
 
     RefPtr<FakeTiledLayerChromium> root = adoptRef(new FakeTiledLayerChromium(ccLayerTreeHost->contentsTextureManager()));
     RefPtr<LayerChromium> surface = LayerChromium::create();