Changeset 119313 in webkit
- Timestamp:
- Jun 1, 2012 11:07:26 PM (12 years ago)
- Location:
- trunk/Source
- Files:
-
- 1 added
- 61 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/Platform/ChangeLog
r119258 r119313 1 2012-06-01 Alexandre Elias <aelias@google.com> 2 3 [chromium] Software compositor initialization and base classes 4 https://bugs.webkit.org/show_bug.cgi?id=87920 5 6 Reviewed by James Robinson. 7 8 Add a new setting to force software compositing. In this mode, 9 no GraphicsContext3D should ever be created. 10 11 * chromium/public/WebLayerTreeView.h: 12 (WebKit::WebLayerTreeView::Settings::Settings): 13 (Settings): 14 1 15 2012-06-01 Mark Pilgrim <pilgrim@chromium.org> 2 16 -
trunk/Source/Platform/chromium/public/WebLayerTreeView.h
r117535 r119313 51 51 Settings() 52 52 : acceleratePainting(false) 53 , forceSoftwareCompositing(false) 53 54 , showFPSCounter(false) 54 55 , showPlatformLayerTree(false) … … 65 66 66 67 bool acceleratePainting; 68 bool forceSoftwareCompositing; 67 69 bool showFPSCounter; 68 70 bool showPlatformLayerTree; -
trunk/Source/WebCore/ChangeLog
r119311 r119313 1 2012-06-01 Alexandre Elias <aelias@google.com> 2 3 [chromium] Software compositor initialization and base classes 4 https://bugs.webkit.org/show_bug.cgi?id=87920 5 6 Reviewed by James Robinson. 7 8 This introduces new wrapper class CCGraphicsContext and base class 9 CCRenderer which will be used for software compositing support. 10 If no GraphicsContext3D is available, early return for now. 11 12 No new tests. (No-op change in 3d mode.) 13 14 * platform/graphics/chromium/BitmapCanvasLayerTextureUpdater.cpp: 15 (WebCore::BitmapCanvasLayerTextureUpdater::Texture::updateRect): 16 (WebCore::BitmapCanvasLayerTextureUpdater::updateTextureRect): 17 * platform/graphics/chromium/BitmapCanvasLayerTextureUpdater.h: 18 (Texture): 19 (BitmapCanvasLayerTextureUpdater): 20 * platform/graphics/chromium/BitmapSkPictureCanvasLayerTextureUpdater.cpp: 21 (WebCore::BitmapSkPictureCanvasLayerTextureUpdater::Texture::updateRect): 22 (WebCore::BitmapSkPictureCanvasLayerTextureUpdater::updateTextureRect): 23 * platform/graphics/chromium/BitmapSkPictureCanvasLayerTextureUpdater.h: 24 (Texture): 25 (BitmapSkPictureCanvasLayerTextureUpdater): 26 * platform/graphics/chromium/CanvasLayerTextureUpdater.h: 27 * platform/graphics/chromium/FrameBufferSkPictureCanvasLayerTextureUpdater.cpp: 28 (WebCore::FrameBufferSkPictureCanvasLayerTextureUpdater::Texture::updateRect): 29 (WebCore::FrameBufferSkPictureCanvasLayerTextureUpdater::updateTextureRect): 30 * platform/graphics/chromium/FrameBufferSkPictureCanvasLayerTextureUpdater.h: 31 (Texture): 32 (FrameBufferSkPictureCanvasLayerTextureUpdater): 33 * platform/graphics/chromium/ImageLayerChromium.cpp: 34 (WebCore::ImageLayerTextureUpdater::Texture::updateRect): 35 (WebCore::ImageLayerTextureUpdater::updateTextureRect): 36 * platform/graphics/chromium/LayerChromium.h: 37 (WebCore): 38 * platform/graphics/chromium/LayerRendererChromium.cpp: 39 (WebCore::CCRenderer::toGLMatrix): 40 (WebCore): 41 (WebCore::LayerRendererChromium::create): 42 (WebCore::CCRenderer::CCRenderer): 43 (WebCore::LayerRendererChromium::LayerRendererChromium): 44 (WebCore::LayerRendererChromium::copyPlaneToTexture): 45 (WebCore::LayerRendererChromium::drawHeadsUpDisplay): 46 (WebCore::LayerRendererChromium::getFramebufferTexture): 47 (WebCore::LayerRendererChromium::bindFramebufferToTexture): 48 * platform/graphics/chromium/LayerRendererChromium.h: 49 (CCRenderer): 50 (WebCore::CCRenderer::~CCRenderer): 51 (WebCore::CCRenderer::ccContext): 52 (WebCore::CCRenderer::settings): 53 (WebCore::CCRenderer::viewportSize): 54 (WebCore::CCRenderer::viewportWidth): 55 (WebCore::CCRenderer::viewportHeight): 56 (WebCore::CCRenderer::projectionMatrix): 57 (WebCore::CCRenderer::windowMatrix): 58 (WebCore::CCRenderer::sharedGeometryQuad): 59 (WebCore): 60 (LayerRendererChromium): 61 * platform/graphics/chromium/LayerTextureSubImage.cpp: 62 (WebCore::LayerTextureSubImage::upload): 63 (WebCore::LayerTextureSubImage::uploadWithTexSubImage): 64 (WebCore::LayerTextureSubImage::uploadWithMapTexSubImage): 65 * platform/graphics/chromium/LayerTextureSubImage.h: 66 (WebCore): 67 (LayerTextureSubImage): 68 * platform/graphics/chromium/LayerTextureUpdater.h: 69 (WebCore): 70 (Texture): 71 * platform/graphics/chromium/ManagedTexture.cpp: 72 (WebCore::ManagedTexture::bindTexture): 73 (WebCore::ManagedTexture::framebufferTexture2D): 74 * platform/graphics/chromium/ManagedTexture.h: 75 (WebCore): 76 (ManagedTexture): 77 * platform/graphics/chromium/RenderSurfaceChromium.cpp: 78 * platform/graphics/chromium/TextureCopier.cpp: 79 (WebCore::AcceleratedTextureCopier::copyTexture): 80 * platform/graphics/chromium/TextureCopier.h: 81 (TextureCopier): 82 (AcceleratedTextureCopier): 83 * platform/graphics/chromium/TextureUploader.h: 84 (TextureUploader): 85 * platform/graphics/chromium/ThrottledTextureUploader.cpp: 86 (WebCore::ThrottledTextureUploader::uploadTexture): 87 * platform/graphics/chromium/ThrottledTextureUploader.h: 88 (ThrottledTextureUploader): 89 * platform/graphics/chromium/cc/CCGraphicsContext.h: Copied from Source/WebCore/platform/graphics/chromium/CanvasLayerTextureUpdater.h. 90 (WebCore): 91 (CCGraphicsContext): 92 (WebCore::CCGraphicsContext::create2D): 93 (WebCore::CCGraphicsContext::create3D): 94 (WebCore::CCGraphicsContext::context3D): 95 (WebCore::CCGraphicsContext::CCGraphicsContext): 96 * platform/graphics/chromium/cc/CCHeadsUpDisplay.cpp: 97 (WebCore::CCHeadsUpDisplay::draw): 98 * platform/graphics/chromium/cc/CCLayerImpl.cpp: 99 (WebCore::CCLayerImpl::willDraw): 100 (WebCore::CCLayerImpl::bindContentsTexture): 101 * platform/graphics/chromium/cc/CCLayerImpl.h: 102 (WebCore): 103 (CCLayerImpl): 104 * platform/graphics/chromium/cc/CCLayerTreeHost.cpp: 105 (WebCore::CCLayerTreeHost::createContext): 106 (WebCore::CCLayerTreeHost::context): 107 * platform/graphics/chromium/cc/CCLayerTreeHost.h: 108 (CCLayerTreeHostClient): 109 (WebCore::CCSettings::CCSettings): 110 (CCSettings): 111 (CCLayerTreeHost): 112 * platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp: 113 (WebCore::CCLayerTreeHostImpl::context): 114 (WebCore::CCLayerTreeHostImpl::initializeLayerRenderer): 115 * platform/graphics/chromium/cc/CCLayerTreeHostImpl.h: 116 (CCLayerTreeHostImpl): 117 (WebCore::CCLayerTreeHostImpl::layerRenderer): 118 * platform/graphics/chromium/cc/CCProxy.h: 119 (WebCore): 120 (CCProxy): 121 * platform/graphics/chromium/cc/CCScrollbarLayerImpl.cpp: 122 (WebCore::CCScrollbarLayerImpl::willDraw): 123 * platform/graphics/chromium/cc/CCScrollbarLayerImpl.h: 124 (CCScrollbarLayerImpl): 125 * platform/graphics/chromium/cc/CCSingleThreadProxy.cpp: 126 (WebCore::CCSingleThreadProxy::context): 127 (WebCore::CCSingleThreadProxy::initializeContext): 128 (WebCore::CCSingleThreadProxy::recreateContext): 129 * platform/graphics/chromium/cc/CCSingleThreadProxy.h: 130 (CCSingleThreadProxy): 131 * platform/graphics/chromium/cc/CCTextureUpdater.cpp: 132 (WebCore::CCTextureUpdater::update): 133 * platform/graphics/chromium/cc/CCTextureUpdater.h: 134 (CCTextureUpdater): 135 * platform/graphics/chromium/cc/CCThreadProxy.cpp: 136 (WebCore::CCThreadProxy::context): 137 (WebCore::CCThreadProxy::initializeContext): 138 (WebCore::CCThreadProxy::recreateContext): 139 (WebCore::CCThreadProxy::beginFrame): 140 (WebCore::CCThreadProxy::initializeContextOnImplThread): 141 (WebCore::CCThreadProxy::recreateContextOnImplThread): 142 * platform/graphics/chromium/cc/CCThreadProxy.h: 143 (CCThreadProxy): 144 * platform/graphics/chromium/cc/CCVideoLayerImpl.cpp: 145 (WebCore::CCVideoLayerImpl::willDraw): 146 (WebCore::CCVideoLayerImpl::willDrawInternal): 147 (WebCore::CCVideoLayerImpl::reserveTextures): 148 * platform/graphics/chromium/cc/CCVideoLayerImpl.h: 149 (CCVideoLayerImpl): 150 1 151 2012-06-01 Sheriff Bot <webkit.review.bot@gmail.com> 2 152 -
trunk/Source/WebCore/platform/graphics/chromium/BitmapCanvasLayerTextureUpdater.cpp
r114827 r119313 47 47 } 48 48 49 void BitmapCanvasLayerTextureUpdater::Texture::updateRect( GraphicsContext3D* context, TextureAllocator* allocator, const IntRect& sourceRect, const IntRect& destRect)49 void BitmapCanvasLayerTextureUpdater::Texture::updateRect(CCGraphicsContext* context, TextureAllocator* allocator, const IntRect& sourceRect, const IntRect& destRect) 50 50 { 51 51 textureUpdater()->updateTextureRect(context, allocator, texture(), sourceRect, destRect); … … 96 96 } 97 97 98 void BitmapCanvasLayerTextureUpdater::updateTextureRect( GraphicsContext3D* context, TextureAllocator* allocator, ManagedTexture* texture, const IntRect& sourceRect, const IntRect& destRect)98 void BitmapCanvasLayerTextureUpdater::updateTextureRect(CCGraphicsContext* context, TextureAllocator* allocator, ManagedTexture* texture, const IntRect& sourceRect, const IntRect& destRect) 99 99 { 100 100 PlatformCanvas::AutoLocker locker(&m_canvas); -
trunk/Source/WebCore/platform/graphics/chromium/BitmapCanvasLayerTextureUpdater.h
r114827 r119313 48 48 virtual ~Texture(); 49 49 50 virtual void updateRect( GraphicsContext3D*, TextureAllocator*, const IntRect& sourceRect, const IntRect& destRect);50 virtual void updateRect(CCGraphicsContext*, TextureAllocator*, const IntRect& sourceRect, const IntRect& destRect); 51 51 52 52 private: … … 62 62 virtual SampledTexelFormat sampledTexelFormat(GC3Denum textureFormat); 63 63 virtual void prepareToUpdate(const IntRect& contentRect, const IntSize& tileSize, int borderTexels, float contentsScale, IntRect& resultingOpaqueRect); 64 void updateTextureRect( GraphicsContext3D*, TextureAllocator*, ManagedTexture*, const IntRect& sourceRect, const IntRect& destRect);64 void updateTextureRect(CCGraphicsContext*, TextureAllocator*, ManagedTexture*, const IntRect& sourceRect, const IntRect& destRect); 65 65 66 66 virtual void setOpaque(bool); -
trunk/Source/WebCore/platform/graphics/chromium/BitmapSkPictureCanvasLayerTextureUpdater.cpp
r114827 r119313 53 53 } 54 54 55 void BitmapSkPictureCanvasLayerTextureUpdater::Texture::updateRect( GraphicsContext3D* context, TextureAllocator* allocator, const IntRect& sourceRect, const IntRect& destRect)55 void BitmapSkPictureCanvasLayerTextureUpdater::Texture::updateRect(CCGraphicsContext* context, TextureAllocator* allocator, const IntRect& sourceRect, const IntRect& destRect) 56 56 { 57 57 texture()->bindTexture(context, allocator); … … 104 104 } 105 105 106 void BitmapSkPictureCanvasLayerTextureUpdater::updateTextureRect( GraphicsContext3D* context, GC3Denum format, const IntRect& destRect, const uint8_t* pixels)106 void BitmapSkPictureCanvasLayerTextureUpdater::updateTextureRect(CCGraphicsContext* context, GC3Denum format, const IntRect& destRect, const uint8_t* pixels) 107 107 { 108 108 m_texSubImage.upload(pixels, destRect, destRect, destRect, format, context); -
trunk/Source/WebCore/platform/graphics/chromium/BitmapSkPictureCanvasLayerTextureUpdater.h
r114827 r119313 45 45 46 46 virtual void prepareRect(const IntRect& sourceRect); 47 virtual void updateRect( GraphicsContext3D*, TextureAllocator*, const IntRect& sourceRect, const IntRect& destRect);47 virtual void updateRect(CCGraphicsContext*, TextureAllocator*, const IntRect& sourceRect, const IntRect& destRect); 48 48 49 49 private: … … 61 61 virtual void prepareToUpdate(const IntRect& contentRect, const IntSize& tileSize, int borderTexels, float contentsScale, IntRect& resultingOpaqueRect); 62 62 void paintContentsRect(SkCanvas*, const IntRect& sourceRect); 63 void updateTextureRect( GraphicsContext3D*, GC3Denum format, const IntRect& destRect, const uint8_t* pixels);63 void updateTextureRect(CCGraphicsContext*, GC3Denum format, const IntRect& destRect, const uint8_t* pixels); 64 64 65 65 private: -
trunk/Source/WebCore/platform/graphics/chromium/CanvasLayerTextureUpdater.h
r114827 r119313 34 34 namespace WebCore { 35 35 36 class GraphicsContext3D;37 36 class LayerPainterChromium; 38 37 class PlatformContextSkia; -
trunk/Source/WebCore/platform/graphics/chromium/FrameBufferSkPictureCanvasLayerTextureUpdater.cpp
r112193 r119313 67 67 } 68 68 69 void FrameBufferSkPictureCanvasLayerTextureUpdater::Texture::updateRect( GraphicsContext3D* context, TextureAllocator* allocator, const IntRect& sourceRect, const IntRect& destRect)69 void FrameBufferSkPictureCanvasLayerTextureUpdater::Texture::updateRect(CCGraphicsContext* context, TextureAllocator* allocator, const IntRect& sourceRect, const IntRect& destRect) 70 70 { 71 71 textureUpdater()->updateTextureRect(context, allocator, texture(), sourceRect, destRect); … … 97 97 } 98 98 99 void FrameBufferSkPictureCanvasLayerTextureUpdater::updateTextureRect( GraphicsContext3D* context, TextureAllocator* allocator, ManagedTexture* texture, const IntRect& sourceRect, const IntRect& destRect)99 void FrameBufferSkPictureCanvasLayerTextureUpdater::updateTextureRect(CCGraphicsContext* context, TextureAllocator* allocator, ManagedTexture* texture, const IntRect& sourceRect, const IntRect& destRect) 100 100 { 101 GraphicsContext3D* context3d = context->context3D(); 102 if (!context3d) { 103 // FIXME: Implement this path for software compositing. 104 return; 105 } 106 101 107 // Make sure ganesh uses the correct GL context. 102 context ->makeContextCurrent();108 context3d->makeContextCurrent(); 103 109 // Notify ganesh to sync its internal GL state. 104 context ->grContext()->resetContext();110 context3d->grContext()->resetContext(); 105 111 106 112 // Create an accelerated canvas to draw on. 107 OwnPtr<SkCanvas> canvas = createAcceleratedCanvas(context , allocator, texture);113 OwnPtr<SkCanvas> canvas = createAcceleratedCanvas(context3d, allocator, texture); 108 114 109 115 // The compositor expects the textures to be upside-down so it can flip … … 121 127 122 128 // Flush ganesh context so that all the rendered stuff appears on the texture. 123 context ->grContext()->flush();129 context3d->grContext()->flush(); 124 130 } 125 131 -
trunk/Source/WebCore/platform/graphics/chromium/FrameBufferSkPictureCanvasLayerTextureUpdater.h
r110267 r119313 44 44 virtual ~Texture(); 45 45 46 virtual void updateRect( GraphicsContext3D*, TextureAllocator*, const IntRect& sourceRect, const IntRect& destRect);46 virtual void updateRect(CCGraphicsContext*, TextureAllocator*, const IntRect& sourceRect, const IntRect& destRect); 47 47 48 48 private: … … 57 57 virtual PassOwnPtr<LayerTextureUpdater::Texture> createTexture(TextureManager*); 58 58 virtual SampledTexelFormat sampledTexelFormat(GC3Denum textureFormat); 59 void updateTextureRect( GraphicsContext3D*, TextureAllocator*, ManagedTexture*, const IntRect& sourceRect, const IntRect& destRect);59 void updateTextureRect(CCGraphicsContext*, TextureAllocator*, ManagedTexture*, const IntRect& sourceRect, const IntRect& destRect); 60 60 61 61 private: -
trunk/Source/WebCore/platform/graphics/chromium/ImageLayerChromium.cpp
r113809 r119313 55 55 } 56 56 57 virtual void updateRect( GraphicsContext3D* context, TextureAllocator* allocator, const IntRect& sourceRect, const IntRect& destRect)57 virtual void updateRect(CCGraphicsContext* context, TextureAllocator* allocator, const IntRect& sourceRect, const IntRect& destRect) 58 58 { 59 59 textureUpdater()->updateTextureRect(context, allocator, texture(), sourceRect, destRect); … … 89 89 } 90 90 91 virtual void updateTextureRect( GraphicsContext3D* context, TextureAllocator* allocator, ManagedTexture* texture, const IntRect& sourceRect, const IntRect& destRect)91 virtual void updateTextureRect(CCGraphicsContext* context, TextureAllocator* allocator, ManagedTexture* texture, const IntRect& sourceRect, const IntRect& destRect) 92 92 { 93 93 texture->bindTexture(context, allocator); -
trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.h
r119311 r119313 63 63 class CCLayerTreeHost; 64 64 class CCTextureUpdater; 65 class GraphicsContext3D;66 65 class ScrollbarLayerChromium; 67 66 -
trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
r119178 r119313 161 161 virtual void beginUploads() { } 162 162 virtual void endUploads() { } 163 virtual void uploadTexture( GraphicsContext3D* context, LayerTextureUpdater::Texture* texture, TextureAllocator* allocator, const IntRect sourceRect, const IntRect destRect) { texture->updateRect(context, allocator, sourceRect, destRect); }163 virtual void uploadTexture(CCGraphicsContext* context, LayerTextureUpdater::Texture* texture, TextureAllocator* allocator, const IntRect sourceRect, const IntRect destRect) { texture->updateRect(context, allocator, sourceRect, destRect); } 164 164 165 165 protected: … … 218 218 219 219 220 PassOwnPtr<LayerRendererChromium> LayerRendererChromium::create( LayerRendererChromiumClient* client, PassRefPtr<GraphicsContext3D> context, TextureUploaderOption textureUploaderSetting)220 PassOwnPtr<LayerRendererChromium> LayerRendererChromium::create(CCRendererClient* client, PassRefPtr<GraphicsContext3D> context, TextureUploaderOption textureUploaderSetting) 221 221 { 222 222 OwnPtr<LayerRendererChromium> layerRenderer(adoptPtr(new LayerRendererChromium(client, context, textureUploaderSetting))); … … 227 227 } 228 228 229 LayerRendererChromium::LayerRendererChromium( LayerRendererChromiumClient* client,229 LayerRendererChromium::LayerRendererChromium(CCRendererClient* client, 230 230 PassRefPtr<GraphicsContext3D> context, 231 231 TextureUploaderOption textureUploaderSetting) 232 : m_client(client)232 : CCRenderer(client) 233 233 , m_currentRenderSurface(0) 234 234 , m_currentManagedTexture(0) 235 235 , m_offscreenFramebufferId(0) 236 , m_sharedGeometryQuad(FloatRect(-0.5f, -0.5f, 1.0f, 1.0f)) 236 237 , m_context(context) 237 238 , m_defaultRenderSurface(0) 238 , m_sharedGeometryQuad(FloatRect(-0.5f, -0.5f, 1.0f, 1.0f))239 239 , m_isViewportChanged(false) 240 240 , m_isFramebufferDiscarded(false) 241 241 , m_textureUploaderSetting(textureUploaderSetting) 242 242 { 243 ASSERT(m_context.get()); 243 244 } 244 245 245 246 class ContextLostCallbackAdapter : public GraphicsContext3D::ContextLostCallback { 246 247 public: 247 static PassOwnPtr<ContextLostCallbackAdapter> create( LayerRendererChromiumClient* client)248 static PassOwnPtr<ContextLostCallbackAdapter> create(CCRendererClient* client) 248 249 { 249 250 return adoptPtr(new ContextLostCallbackAdapter(client)); … … 256 257 257 258 private: 258 explicit ContextLostCallbackAdapter( LayerRendererChromiumClient* client)259 explicit ContextLostCallbackAdapter(CCRendererClient* client) 259 260 : m_client(client) { } 260 261 261 LayerRendererChromiumClient* m_client;262 CCRendererClient* m_client; 262 263 }; 263 264 … … 1078 1079 CCVideoLayerImpl::Texture& texture = quad->textures()[index]; 1079 1080 TextureAllocator* allocator = renderSurfaceTextureAllocator(); 1080 texture.m_texture->bindTexture(context(), allocator); 1081 RefPtr<CCGraphicsContext> ccContext = CCGraphicsContext::create3D(m_context); 1082 texture.m_texture->bindTexture(ccContext.get(), allocator); 1081 1083 GC3Denum format = texture.m_texture->format(); 1082 1084 IntSize dimensions = texture.m_texture->size(); … … 1218 1220 ASSERT(program && program->initialized()); 1219 1221 GLC(m_context, m_context->activeTexture(GraphicsContext3D::TEXTURE0)); 1220 hudTexture->bindTexture(m_context.get(), renderSurfaceTextureAllocator()); 1222 RefPtr<CCGraphicsContext> ccContext = CCGraphicsContext::create3D(m_context); 1223 hudTexture->bindTexture(ccContext.get(), renderSurfaceTextureAllocator()); 1221 1224 GLC(m_context, m_context->useProgram(program->program())); 1222 1225 GLC(m_context, m_context->uniform1i(program->fragmentShader().samplerLocation(), 0)); … … 1443 1446 return false; 1444 1447 1445 texture->bindTexture(m_context.get(), m_renderSurfaceTextureAllocator.get()); 1448 RefPtr<CCGraphicsContext> ccContext = CCGraphicsContext::create3D(m_context); 1449 texture->bindTexture(ccContext.get(), m_renderSurfaceTextureAllocator.get()); 1446 1450 GLC(m_context, m_context->copyTexImage2D(GraphicsContext3D::TEXTURE_2D, 0, texture->format(), 1447 1451 deviceRect.x(), deviceRect.y(), deviceRect.width(), deviceRect.height(), 0)); … … 1485 1489 GLC(m_context, m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_offscreenFramebufferId)); 1486 1490 1487 texture->framebufferTexture2D(m_context.get(), m_renderSurfaceTextureAllocator.get()); 1491 RefPtr<CCGraphicsContext> ccContext = CCGraphicsContext::create3D(m_context); 1492 texture->framebufferTexture2D(ccContext.get(), m_renderSurfaceTextureAllocator.get()); 1488 1493 1489 1494 #if !defined ( NDEBUG ) -
trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h
r119178 r119313 35 35 #if USE(ACCELERATED_COMPOSITING) 36 36 37 #include "FloatQuad.h"38 #include "IntRect.h"39 37 #include "TextureCopier.h" 40 38 #include "ThrottledTextureUploader.h" 41 39 #include "TrackingTextureAllocator.h" 42 #include "cc/CCLayerTreeHost.h" 43 #include <wtf/HashMap.h> 44 #include <wtf/Noncopyable.h> 40 #include "cc/CCRenderer.h" 45 41 #include <wtf/PassOwnPtr.h> 46 #include <wtf/PassRefPtr.h>47 #include <wtf/Vector.h>48 42 49 43 namespace WebCore { … … 53 47 class CCDrawQuad; 54 48 class CCIOSurfaceDrawQuad; 55 class CCRenderPass;56 49 class CCRenderSurfaceDrawQuad; 57 50 class CCSolidColorDrawQuad; … … 65 58 class ScopedEnsureFramebufferAllocation; 66 59 67 class LayerRendererChromiumClient {68 public:69 virtual const IntSize& deviceViewportSize() const = 0;70 virtual const CCSettings& settings() const = 0;71 virtual void didLoseContext() = 0;72 virtual void onSwapBuffersComplete() = 0;73 virtual void setFullRootLayerDamage() = 0;74 virtual void setContentsMemoryAllocationLimitBytes(size_t) = 0;75 };76 77 60 enum TextureUploaderOption { ThrottledUploader, UnthrottledUploader }; 78 61 79 62 // Class that handles drawing of composited render layers using GL. 80 class LayerRendererChromium {63 class LayerRendererChromium : public CCRenderer { 81 64 WTF_MAKE_NONCOPYABLE(LayerRendererChromium); 82 65 public: 83 static PassOwnPtr<LayerRendererChromium> create(LayerRendererChromiumClient*, PassRefPtr<GraphicsContext3D>, TextureUploaderOption); 84 85 ~LayerRendererChromium(); 86 87 const CCSettings& settings() const { return m_client->settings(); } 88 const LayerRendererCapabilities& capabilities() const { return m_capabilities; } 66 static PassOwnPtr<LayerRendererChromium> create(CCRendererClient*, PassRefPtr<GraphicsContext3D>, TextureUploaderOption); 67 68 virtual ~LayerRendererChromium(); 69 70 virtual const LayerRendererCapabilities& capabilities() const OVERRIDE { return m_capabilities; } 89 71 90 72 GraphicsContext3D* context(); 91 bool contextSupportsMapSub() const { return m_capabilities.usingMapSub; } 92 93 void viewportChanged(); 94 95 void beginDrawingFrame(CCRenderSurface* defaultRenderSurface); 96 void drawRenderPass(const CCRenderPass*); 97 void finishDrawingFrame(); 98 99 void drawHeadsUpDisplay(ManagedTexture*, const IntSize& hudSize); 73 74 virtual void viewportChanged() OVERRIDE; 75 76 const FloatQuad& sharedGeometryQuad() const { return m_sharedGeometryQuad; } 77 78 virtual void beginDrawingFrame(CCRenderSurface* defaultRenderSurface) OVERRIDE; 79 virtual void drawRenderPass(const CCRenderPass*) OVERRIDE; 80 virtual void finishDrawingFrame() OVERRIDE; 81 82 virtual void drawHeadsUpDisplay(ManagedTexture*, const IntSize& hudSize) OVERRIDE; 100 83 101 84 // waits for rendering to finish 102 v oid finish();103 104 v oid doNoOp();85 virtual void finish() OVERRIDE; 86 87 virtual void doNoOp() OVERRIDE; 105 88 // puts backbuffer onscreen 106 bool swapBuffers(const IntRect& subBuffer);89 virtual bool swapBuffers(const IntRect& subBuffer) OVERRIDE; 107 90 108 91 static void debugGLCall(GraphicsContext3D*, const char* command, const char* file, int line); 109 92 110 const WebKit::WebTransformationMatrix& projectionMatrix() const { return m_projectionMatrix; }111 const WebKit::WebTransformationMatrix& windowMatrix() const { return m_windowMatrix; }112 113 93 const GeometryBinding* sharedGeometry() const { return m_sharedGeometry.get(); } 114 const FloatQuad& sharedGeometryQuad() const { return m_sharedGeometryQuad; } 115 116 117 void getFramebufferPixels(void *pixels, const IntRect&); 94 95 96 virtual void getFramebufferPixels(void *pixels, const IntRect&) OVERRIDE; 118 97 bool getFramebufferTexture(ManagedTexture*, const IntRect& deviceRect); 119 98 120 TextureManager* renderSurfaceTextureManager() const { return m_renderSurfaceTextureManager.get(); } 121 TextureCopier* textureCopier() const { return m_textureCopier.get(); } 122 TextureUploader* textureUploader() const { return m_textureUploader.get(); } 123 TextureAllocator* renderSurfaceTextureAllocator() const { return m_renderSurfaceTextureAllocator.get(); } 124 TextureAllocator* contentsTextureAllocator() const { return m_contentsTextureAllocator.get(); } 125 126 void setScissorToRect(const IntRect&); 127 128 bool isContextLost(); 129 130 void setVisible(bool); 131 132 GC3Denum bestTextureFormat(); 133 134 static void toGLMatrix(float*, const WebKit::WebTransformationMatrix&); 99 virtual TextureManager* renderSurfaceTextureManager() const OVERRIDE { return m_renderSurfaceTextureManager.get(); } 100 virtual TextureCopier* textureCopier() const OVERRIDE { return m_textureCopier.get(); } 101 virtual TextureUploader* textureUploader() const OVERRIDE { return m_textureUploader.get(); } 102 virtual TextureAllocator* renderSurfaceTextureAllocator() const OVERRIDE { return m_renderSurfaceTextureAllocator.get(); } 103 virtual TextureAllocator* contentsTextureAllocator() const OVERRIDE { return m_contentsTextureAllocator.get(); } 104 105 virtual void setScissorToRect(const IntRect&) OVERRIDE; 106 107 virtual bool isContextLost() OVERRIDE; 108 109 virtual void setVisible(bool) OVERRIDE; 110 135 111 void drawTexturedQuad(const WebKit::WebTransformationMatrix& layerMatrix, 136 112 float width, float height, float opacity, const FloatQuad&, … … 144 120 bool isFramebufferDiscarded() const { return m_isFramebufferDiscarded; } 145 121 146 LayerRendererChromium( LayerRendererChromiumClient*, PassRefPtr<GraphicsContext3D>, TextureUploaderOption);122 LayerRendererChromium(CCRendererClient*, PassRefPtr<GraphicsContext3D>, TextureUploaderOption); 147 123 bool initialize(); 148 124 149 125 private: 150 const IntSize& viewportSize() { return m_client->deviceViewportSize(); } 151 int viewportWidth() { return viewportSize().width(); } 152 int viewportHeight() { return viewportSize().height(); } 126 static void toGLMatrix(float*, const WebKit::WebTransformationMatrix&); 153 127 154 128 void drawQuad(const CCDrawQuad*, const FloatRect& surfaceDamageRect); … … 192 166 void onSwapBuffersComplete(); 193 167 194 LayerRendererChromiumClient* m_client;195 196 168 LayerRendererCapabilities m_capabilities; 197 198 WebKit::WebTransformationMatrix m_projectionMatrix;199 WebKit::WebTransformationMatrix m_windowMatrix;200 169 201 170 CCRenderSurface* m_currentRenderSurface; … … 204 173 205 174 OwnPtr<GeometryBinding> m_sharedGeometry; 175 FloatQuad m_sharedGeometryQuad; 206 176 207 177 // This block of bindings defines all of the programs used by the compositor itself. … … 298 268 CCRenderSurface* m_defaultRenderSurface; 299 269 300 FloatQuad m_sharedGeometryQuad;301 302 270 bool m_isViewportChanged; 303 271 bool m_isFramebufferDiscarded; -
trunk/Source/WebCore/platform/graphics/chromium/LayerTextureSubImage.cpp
r95901 r119313 31 31 32 32 #include "Extensions3DChromium.h" 33 #include "GraphicsContext3D.h"34 33 #include "TraceEvent.h" 34 #include "cc/CCGraphicsContext.h" 35 35 36 36 namespace WebCore { … … 56 56 void LayerTextureSubImage::upload(const uint8_t* image, const IntRect& imageRect, 57 57 const IntRect& sourceRect, const IntRect& destRect, 58 GC3Denum format, GraphicsContext3D* context)58 GC3Denum format, CCGraphicsContext* context) 59 59 { 60 60 if (m_useMapTexSubImage) … … 66 66 void LayerTextureSubImage::uploadWithTexSubImage(const uint8_t* image, const IntRect& imageRect, 67 67 const IntRect& sourceRect, const IntRect& destRect, 68 GC3Denum format, GraphicsContext3D* context)68 GC3Denum format, CCGraphicsContext* context) 69 69 { 70 70 TRACE_EVENT("LayerTextureSubImage::uploadWithTexSubImage", this, 0); … … 88 88 pixelSource = &m_subImage[0]; 89 89 } 90 context->texSubImage2D(GraphicsContext3D::TEXTURE_2D, 0, destRect.x(), destRect.y(), destRect.width(), destRect.height(), format, GraphicsContext3D::UNSIGNED_BYTE, pixelSource); 90 91 GraphicsContext3D* context3d = context->context3D(); 92 if (!context3d) { 93 // FIXME: Implement this path for software compositing. 94 return; 95 } 96 context3d->texSubImage2D(GraphicsContext3D::TEXTURE_2D, 0, destRect.x(), destRect.y(), destRect.width(), destRect.height(), format, GraphicsContext3D::UNSIGNED_BYTE, pixelSource); 91 97 } 92 98 93 99 void LayerTextureSubImage::uploadWithMapTexSubImage(const uint8_t* image, const IntRect& imageRect, 94 100 const IntRect& sourceRect, const IntRect& destRect, 95 GC3Denum format, GraphicsContext3D* context)101 GC3Denum format, CCGraphicsContext* context) 96 102 { 97 103 TRACE_EVENT("LayerTextureSubImage::uploadWithMapTexSubImage", this, 0); 104 GraphicsContext3D* context3d = context->context3D(); 105 if (!context3d) { 106 // FIXME: Implement this path for software compositing. 107 return; 108 } 109 98 110 // Offset from image-rect to source-rect. 99 111 IntPoint offset(sourceRect.x() - imageRect.x(), sourceRect.y() - imageRect.y()); 100 112 101 113 // Upload tile data via a mapped transfer buffer 102 Extensions3DChromium* extensions = static_cast<Extensions3DChromium*>(context ->getExtensions());114 Extensions3DChromium* extensions = static_cast<Extensions3DChromium*>(context3d->getExtensions()); 103 115 uint8_t* pixelDest = static_cast<uint8_t*>(extensions->mapTexSubImage2DCHROMIUM(GraphicsContext3D::TEXTURE_2D, 0, destRect.x(), destRect.y(), destRect.width(), destRect.height(), format, GraphicsContext3D::UNSIGNED_BYTE, Extensions3DChromium::WRITE_ONLY)); 104 116 -
trunk/Source/WebCore/platform/graphics/chromium/LayerTextureSubImage.h
r95901 r119313 37 37 namespace WebCore { 38 38 39 class GraphicsContext3D;39 class CCGraphicsContext; 40 40 41 41 class LayerTextureSubImage { … … 47 47 void upload(const uint8_t* image, const IntRect& imageRect, 48 48 const IntRect& sourceRect, const IntRect& destRect, 49 GC3Denum format, GraphicsContext3D*);49 GC3Denum format, CCGraphicsContext*); 50 50 51 51 private: 52 52 void uploadWithTexSubImage(const uint8_t* image, const IntRect& imageRect, 53 53 const IntRect& sourceRect, const IntRect& destRect, 54 GC3Denum format, GraphicsContext3D*);54 GC3Denum format, CCGraphicsContext*); 55 55 void uploadWithMapTexSubImage(const uint8_t* image, const IntRect& imageRect, 56 56 const IntRect& sourceRect, const IntRect& destRect, 57 GC3Denum format, GraphicsContext3D*);57 GC3Denum format, CCGraphicsContext*); 58 58 59 59 bool m_useMapTexSubImage; … … 65 65 #endif // USE(ACCELERATED_COMPOSITING) 66 66 #endif // LayerTextureSubImage_h 67 -
trunk/Source/WebCore/platform/graphics/chromium/LayerTextureUpdater.h
r114827 r119313 32 32 #include "ManagedTexture.h" 33 33 #include "GraphicsTypes3D.h" 34 #include "cc/CCGraphicsContext.h" 34 35 #include <wtf/RefCounted.h> 35 36 36 37 namespace WebCore { 37 38 38 class GraphicsContext3D;39 class CCGraphicsContext; 39 40 class IntRect; 40 41 class IntSize; … … 51 52 ManagedTexture* texture() { return m_texture.get(); } 52 53 virtual void prepareRect(const IntRect& /* sourceRect */) { } 53 virtual void updateRect( GraphicsContext3D*, TextureAllocator*, const IntRect& sourceRect, const IntRect& destRect) = 0;54 virtual void updateRect(CCGraphicsContext*, TextureAllocator*, const IntRect& sourceRect, const IntRect& destRect) = 0; 54 55 protected: 55 56 explicit Texture(PassOwnPtr<ManagedTexture> texture) : m_texture(texture) { } -
trunk/Source/WebCore/platform/graphics/chromium/ManagedTexture.cpp
r107014 r119313 31 31 #include "GraphicsContext3D.h" 32 32 #include "TextureManager.h" 33 #include "cc/CCGraphicsContext.h" 33 34 34 35 namespace WebCore { … … 118 119 } 119 120 120 void ManagedTexture::bindTexture( GraphicsContext3D* context, TextureAllocator* allocator)121 void ManagedTexture::bindTexture(CCGraphicsContext* context, TextureAllocator* allocator) 121 122 { 122 123 allocate(allocator); 123 context->bindTexture(GraphicsContext3D::TEXTURE_2D, m_textureId); 124 GraphicsContext3D* context3d = context->context3D(); 125 if (!context3d) { 126 // FIXME: Implement this path for software compositing. 127 return; 128 } 129 context3d->bindTexture(GraphicsContext3D::TEXTURE_2D, m_textureId); 124 130 } 125 131 126 void ManagedTexture::framebufferTexture2D( GraphicsContext3D* context, TextureAllocator* allocator)132 void ManagedTexture::framebufferTexture2D(CCGraphicsContext* context, TextureAllocator* allocator) 127 133 { 128 134 allocate(allocator); 129 context->framebufferTexture2D(GraphicsContext3D::FRAMEBUFFER, GraphicsContext3D::COLOR_ATTACHMENT0, GraphicsContext3D::TEXTURE_2D, m_textureId, 0); 135 GraphicsContext3D* context3d = context->context3D(); 136 if (!context3d) { 137 // FIXME: Implement this path for software compositing. 138 return; 139 } 140 context3d->framebufferTexture2D(GraphicsContext3D::FRAMEBUFFER, GraphicsContext3D::COLOR_ATTACHMENT0, GraphicsContext3D::TEXTURE_2D, m_textureId, 0); 130 141 } 131 142 -
trunk/Source/WebCore/platform/graphics/chromium/ManagedTexture.h
r106891 r119313 36 36 namespace WebCore { 37 37 38 class GraphicsContext3D;38 class CCGraphicsContext; 39 39 40 40 class ManagedTexture { … … 59 59 60 60 void allocate(TextureAllocator*); 61 void bindTexture( GraphicsContext3D*, TextureAllocator*);62 void framebufferTexture2D( GraphicsContext3D*, TextureAllocator*);61 void bindTexture(CCGraphicsContext*, TextureAllocator*); 62 void framebufferTexture2D(CCGraphicsContext*, TextureAllocator*); 63 63 64 64 IntSize size() const { return m_size; } -
trunk/Source/WebCore/platform/graphics/chromium/RenderSurfaceChromium.cpp
r118803 r119313 31 31 32 32 #include "FilterOperations.h" 33 #include "GraphicsContext3D.h"34 33 #include "LayerChromium.h" 35 34 #include "LayerRendererChromium.h" -
trunk/Source/WebCore/platform/graphics/chromium/TextureCopier.cpp
r115285 r119313 62 62 } 63 63 64 void AcceleratedTextureCopier::copyTexture( GraphicsContext3D* context, unsigned sourceTextureId, unsigned destTextureId, const IntSize& size)64 void AcceleratedTextureCopier::copyTexture(CCGraphicsContext* ccContext, unsigned sourceTextureId, unsigned destTextureId, const IntSize& size) 65 65 { 66 66 TRACE_EVENT("TextureCopier::copyTexture", this, 0); 67 68 GraphicsContext3D* context = ccContext->context3D(); 69 if (!context) { 70 // FIXME: Implement this path for software compositing. 71 return; 72 } 67 73 68 74 // Note: this code does not restore the viewport, bound program, 2D texture, framebuffer, buffer or blend enable. -
trunk/Source/WebCore/platform/graphics/chromium/TextureCopier.h
r112286 r119313 29 29 #include "ProgramBinding.h" 30 30 #include "ShaderChromium.h" 31 #include "cc/CCGraphicsContext.h" 31 32 #include <wtf/PassRefPtr.h> 32 33 … … 38 39 // must be complete and have a base level of |size| dimensions. The color formats do not need 39 40 // to match, but |destTextureId| must have a renderable format. 40 virtual void copyTexture( GraphicsContext3D*, unsigned sourceTextureId, unsigned destTextureId, const IntSize&) = 0;41 virtual void copyTexture(CCGraphicsContext*, unsigned sourceTextureId, unsigned destTextureId, const IntSize&) = 0; 41 42 42 43 protected: … … 55 56 virtual ~AcceleratedTextureCopier(); 56 57 57 virtual void copyTexture( GraphicsContext3D*, unsigned sourceTextureId, unsigned destTextureId, const IntSize&);58 virtual void copyTexture(CCGraphicsContext*, unsigned sourceTextureId, unsigned destTextureId, const IntSize&); 58 59 59 60 protected: -
trunk/Source/WebCore/platform/graphics/chromium/TextureUploader.h
r116351 r119313 37 37 virtual void beginUploads() = 0; 38 38 virtual void endUploads() = 0; 39 virtual void uploadTexture( GraphicsContext3D*, LayerTextureUpdater::Texture*, TextureAllocator*, const IntRect sourceRect, const IntRect destRect) = 0;39 virtual void uploadTexture(CCGraphicsContext*, LayerTextureUpdater::Texture*, TextureAllocator*, const IntRect sourceRect, const IntRect destRect) = 0; 40 40 }; 41 41 -
trunk/Source/WebCore/platform/graphics/chromium/ThrottledTextureUploader.cpp
r116351 r119313 125 125 } 126 126 127 void ThrottledTextureUploader::uploadTexture( GraphicsContext3D* context, LayerTextureUpdater::Texture* texture, TextureAllocator* allocator, const IntRect sourceRect, const IntRect destRect)127 void ThrottledTextureUploader::uploadTexture(CCGraphicsContext* context, LayerTextureUpdater::Texture* texture, TextureAllocator* allocator, const IntRect sourceRect, const IntRect destRect) 128 128 { 129 129 texture->updateRect(context, allocator, sourceRect, destRect); -
trunk/Source/WebCore/platform/graphics/chromium/ThrottledTextureUploader.h
r116351 r119313 48 48 virtual void beginUploads() OVERRIDE; 49 49 virtual void endUploads() OVERRIDE; 50 virtual void uploadTexture( GraphicsContext3D*, LayerTextureUpdater::Texture*, TextureAllocator*, const IntRect sourceRect, const IntRect destRect) OVERRIDE;50 virtual void uploadTexture(CCGraphicsContext*, LayerTextureUpdater::Texture*, TextureAllocator*, const IntRect sourceRect, const IntRect destRect) OVERRIDE; 51 51 52 52 private: -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCGraphicsContext.h
r119312 r119313 24 24 */ 25 25 26 #ifndef CC IOSurfaceLayerImpl_h27 #define CC IOSurfaceLayerImpl_h26 #ifndef CCGraphicsContext_h 27 #define CCGraphicsContext_h 28 28 29 #include " IntSize.h"30 #include "cc/CCLayerImpl.h"29 #include "GraphicsContext3D.h" 30 #include <wtf/PassRefPtr.h> 31 31 32 32 namespace WebCore { 33 33 34 class CCIOSurfaceLayerImpl : public CCLayerImpl { 34 class GraphicsContext3D; 35 36 class CCGraphicsContext : public RefCounted<CCGraphicsContext> { 35 37 public: 36 static Pass OwnPtr<CCIOSurfaceLayerImpl> create(int id)38 static PassRefPtr<CCGraphicsContext> create2D() 37 39 { 38 return adopt Ptr(new CCIOSurfaceLayerImpl(id));40 return adoptRef(new CCGraphicsContext()); 39 41 } 40 virtual ~CCIOSurfaceLayerImpl(); 42 static PassRefPtr<CCGraphicsContext> create3D(PassRefPtr<GraphicsContext3D> context3D) 43 { 44 return adoptRef(new CCGraphicsContext(context3D)); 45 } 41 46 42 void setIOSurfaceProperties(unsigned ioSurfaceId, const IntSize&); 43 44 virtual void appendQuads(CCQuadCuller&, const CCSharedQuadState*, bool& hadMissingTiles) OVERRIDE; 45 46 virtual void willDraw(LayerRendererChromium*) OVERRIDE; 47 virtual void didLoseContext() OVERRIDE; 48 49 virtual void dumpLayerProperties(TextStream&, int indent) const OVERRIDE; 47 GraphicsContext3D* context3D() { return m_context3D.get(); } 50 48 51 49 private: 52 explicit CCIOSurfaceLayerImpl(int); 50 CCGraphicsContext() { } 51 explicit CCGraphicsContext(PassRefPtr<GraphicsContext3D> context3D) 52 : m_context3D(context3D) { } 53 53 54 virtual const char* layerTypeAsString() const OVERRIDE { return "IOSurfaceLayer"; } 55 56 unsigned m_ioSurfaceId; 57 IntSize m_ioSurfaceSize; 58 bool m_ioSurfaceChanged; 59 unsigned m_ioSurfaceTextureId; 54 RefPtr<GraphicsContext3D> m_context3D; 60 55 }; 61 56 62 57 } 63 58 64 #endif // CC IOSurfaceLayerImpl_h59 #endif // CCGraphicsContext_h -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCHeadsUpDisplay.cpp
r114963 r119313 70 70 void CCHeadsUpDisplay::draw(CCLayerTreeHostImpl* layerTreeHostImpl) 71 71 { 72 LayerRendererChromium* layerRenderer = layerTreeHostImpl->layerRenderer(); 73 GraphicsContext3D* context = layerRenderer->context(); 72 CCRenderer* layerRenderer = layerTreeHostImpl->layerRenderer(); 73 GraphicsContext3D* context = layerTreeHostImpl->context()->context3D(); 74 if (!context) { 75 // FIXME: Implement this path for software compositing. 76 return; 77 } 74 78 if (!m_hudTexture) 75 79 m_hudTexture = ManagedTexture::create(layerRenderer->renderSurfaceTextureManager()); … … 102 106 PlatformCanvas::AutoLocker locker(&canvas); 103 107 104 m_hudTexture->bindTexture( context, layerRenderer->renderSurfaceTextureAllocator());108 m_hudTexture->bindTexture(layerTreeHostImpl->context(), layerRenderer->renderSurfaceTextureAllocator()); 105 109 bool uploadedViaMap = false; 106 if (layerRenderer->c ontextSupportsMapSub()) {110 if (layerRenderer->capabilities().usingMapSub) { 107 111 Extensions3DChromium* extensions = static_cast<Extensions3DChromium*>(context->getExtensions()); 108 112 uint8_t* pixelDest = static_cast<uint8_t*>(extensions->mapTexSubImage2DCHROMIUM(GraphicsContext3D::TEXTURE_2D, 0, 0, 0, hudSize.width(), hudSize.height(), GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE, Extensions3DChromium::WRITE_ONLY)); -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCIOSurfaceLayerImpl.cpp
r115509 r119313 54 54 } 55 55 56 void CCIOSurfaceLayerImpl::willDraw( LayerRendererChromium* layerRenderer)56 void CCIOSurfaceLayerImpl::willDraw(CCRenderer* layerRenderer, CCGraphicsContext* context) 57 57 { 58 CCLayerImpl::willDraw(layerRenderer );58 CCLayerImpl::willDraw(layerRenderer, context); 59 59 60 60 if (m_ioSurfaceChanged) { 61 GraphicsContext3D* context = layerRenderer->context(); 62 Extensions3DChromium* extensions = static_cast<Extensions3DChromium*>(context->getExtensions()); 61 GraphicsContext3D* context3d = context->context3D(); 62 if (!context3d) { 63 // FIXME: Implement this path for software compositing. 64 return; 65 } 66 Extensions3DChromium* extensions = static_cast<Extensions3DChromium*>(context3d->getExtensions()); 63 67 ASSERT(extensions->supports("GL_CHROMIUM_iosurface")); 64 68 ASSERT(extensions->supports("GL_ARB_texture_rectangle")); 65 69 66 70 if (!m_ioSurfaceTextureId) 67 m_ioSurfaceTextureId = context ->createTexture();71 m_ioSurfaceTextureId = context3d->createTexture(); 68 72 69 GLC(context , context->activeTexture(GraphicsContext3D::TEXTURE0));70 GLC(context , context->bindTexture(Extensions3D::TEXTURE_RECTANGLE_ARB, m_ioSurfaceTextureId));71 GLC(context , context->texParameteri(Extensions3D::TEXTURE_RECTANGLE_ARB, GraphicsContext3D::TEXTURE_MIN_FILTER, GraphicsContext3D::LINEAR));72 GLC(context , context->texParameteri(Extensions3D::TEXTURE_RECTANGLE_ARB, GraphicsContext3D::TEXTURE_MAG_FILTER, GraphicsContext3D::LINEAR));73 GLC(context , context->texParameteri(Extensions3D::TEXTURE_RECTANGLE_ARB, GraphicsContext3D::TEXTURE_WRAP_S, GraphicsContext3D::CLAMP_TO_EDGE));74 GLC(context , context->texParameteri(Extensions3D::TEXTURE_RECTANGLE_ARB, GraphicsContext3D::TEXTURE_WRAP_T, GraphicsContext3D::CLAMP_TO_EDGE));73 GLC(context3d, context3d->activeTexture(GraphicsContext3D::TEXTURE0)); 74 GLC(context3d, context3d->bindTexture(Extensions3D::TEXTURE_RECTANGLE_ARB, m_ioSurfaceTextureId)); 75 GLC(context3d, context3d->texParameteri(Extensions3D::TEXTURE_RECTANGLE_ARB, GraphicsContext3D::TEXTURE_MIN_FILTER, GraphicsContext3D::LINEAR)); 76 GLC(context3d, context3d->texParameteri(Extensions3D::TEXTURE_RECTANGLE_ARB, GraphicsContext3D::TEXTURE_MAG_FILTER, GraphicsContext3D::LINEAR)); 77 GLC(context3d, context3d->texParameteri(Extensions3D::TEXTURE_RECTANGLE_ARB, GraphicsContext3D::TEXTURE_WRAP_S, GraphicsContext3D::CLAMP_TO_EDGE)); 78 GLC(context3d, context3d->texParameteri(Extensions3D::TEXTURE_RECTANGLE_ARB, GraphicsContext3D::TEXTURE_WRAP_T, GraphicsContext3D::CLAMP_TO_EDGE)); 75 79 extensions->texImageIOSurface2DCHROMIUM(Extensions3D::TEXTURE_RECTANGLE_ARB, 76 80 m_ioSurfaceSize.width(), -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCIOSurfaceLayerImpl.h
r115509 r119313 44 44 virtual void appendQuads(CCQuadCuller&, const CCSharedQuadState*, bool& hadMissingTiles) OVERRIDE; 45 45 46 virtual void willDraw( LayerRendererChromium*) OVERRIDE;46 virtual void willDraw(CCRenderer*, CCGraphicsContext*) OVERRIDE; 47 47 virtual void didLoseContext() OVERRIDE; 48 48 -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.cpp
r119178 r119313 30 30 #include "cc/CCLayerImpl.h" 31 31 32 #include "GraphicsContext3D.h"33 32 #include "LayerChromium.h" 34 33 #include "LayerRendererChromium.h" … … 146 145 } 147 146 148 void CCLayerImpl::willDraw( LayerRendererChromium*)147 void CCLayerImpl::willDraw(CCRenderer*, CCGraphicsContext*) 149 148 { 150 149 #ifndef NDEBUG -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.h
r119311 r119313 44 44 namespace WebCore { 45 45 46 class CCGraphicsContext; 46 47 class CCLayerSorter; 47 48 class CCQuadCuller; 49 class CCRenderer; 48 50 class LayerChromium; 49 class LayerRendererChromium;50 51 51 52 class CCLayerImpl : public CCLayerAnimationControllerClient { … … 84 85 // the layer is destroyed. To enforce this, any class that overrides 85 86 // willDraw/didDraw must call the base class version. 86 virtual void willDraw( LayerRendererChromium*);87 virtual void willDraw(CCRenderer*, CCGraphicsContext*); 87 88 virtual void appendQuads(CCQuadCuller&, const CCSharedQuadState*, bool& hadMissingTiles) { } 88 89 virtual void didDraw(); -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp
r119178 r119313 266 266 } 267 267 268 PassRefPtr<GraphicsContext3D> CCLayerTreeHost::createContext() 269 { 270 return m_client->createContext(); 268 PassRefPtr<CCGraphicsContext> CCLayerTreeHost::createContext() 269 { 270 RefPtr<CCGraphicsContext> context; 271 if (settings().forceSoftwareCompositing) 272 return CCGraphicsContext::create2D(); 273 return CCGraphicsContext::create3D(m_client->createContext3D()); 271 274 } 272 275 … … 286 289 287 290 // Temporary hack until WebViewImpl context creation gets simplified 288 GraphicsContext3D* CCLayerTreeHost::context()291 CCGraphicsContext* CCLayerTreeHost::context() 289 292 { 290 293 return m_proxy->context(); -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h
r119178 r119313 32 32 #include "RateLimiter.h" 33 33 #include "cc/CCAnimationEvents.h" 34 #include "cc/CCGraphicsContext.h" 34 35 #include "cc/CCLayerTreeHostCommon.h" 35 36 #include "cc/CCProxy.h" … … 60 61 virtual void layout() = 0; 61 62 virtual void applyScrollAndScale(const IntSize& scrollDelta, float pageScale) = 0; 62 virtual PassRefPtr<GraphicsContext3D> createContext () = 0;63 virtual PassRefPtr<GraphicsContext3D> createContext3D() = 0; 63 64 virtual void didRecreateContext(bool success) = 0; 64 65 virtual void willCommit() = 0; … … 77 78 CCSettings() 78 79 : acceleratePainting(false) 80 , forceSoftwareCompositing(false) 79 81 , showFPSCounter(false) 80 82 , showPlatformLayerTree(false) … … 93 95 94 96 bool acceleratePainting; 97 bool forceSoftwareCompositing; 95 98 bool showFPSCounter; 96 99 bool showPlatformLayerTree; … … 160 163 void finishCommitOnImplThread(CCLayerTreeHostImpl*); 161 164 void commitComplete(); 162 PassRefPtr< GraphicsContext3D> createContext();165 PassRefPtr<CCGraphicsContext> createContext(); 163 166 virtual PassOwnPtr<CCLayerTreeHostImpl> createLayerTreeHostImpl(CCLayerTreeHostImplClient*); 164 167 void didLoseContext(); … … 187 190 // NOTE: The returned value can only be used to make GL calls or make the 188 191 // context current on the thread the compositor is running on! 189 GraphicsContext3D* context();192 CCGraphicsContext* context(); 190 193 191 194 // Composites and attempts to read back the result into the provided -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp
r119178 r119313 28 28 29 29 #include "Extensions3D.h" 30 #include "GraphicsContext3D.h"31 30 #include "LayerRendererChromium.h" 32 31 #include "TraceEvent.h" … … 168 167 } 169 168 170 GraphicsContext3D* CCLayerTreeHostImpl::context()171 { 172 return m_ layerRenderer ? m_layerRenderer->context() : 0;169 CCGraphicsContext* CCLayerTreeHostImpl::context() 170 { 171 return m_context.get(); 173 172 } 174 173 … … 332 331 pass->appendQuadsForRenderSurfaceLayer(*it, &occlusionTracker); 333 332 else if (it.representsItself() && !it->visibleLayerRect().isEmpty()) { 334 it->willDraw(m_layerRenderer.get() );333 it->willDraw(m_layerRenderer.get(), context()); 335 334 pass->appendQuadsForLayer(*it, &occlusionTracker, hadMissingTiles); 336 335 } … … 548 547 } 549 548 550 bool CCLayerTreeHostImpl::initializeLayerRenderer(PassRefPtr<GraphicsContext3D> context, TextureUploaderOption textureUploader) 551 { 549 bool CCLayerTreeHostImpl::initializeLayerRenderer(PassRefPtr<CCGraphicsContext> context, TextureUploaderOption textureUploader) 550 { 551 GraphicsContext3D* context3d = context->context3D(); 552 if (!context3d) { 553 // FIXME: Implement this path for software compositing. 554 return false; 555 } 556 552 557 OwnPtr<LayerRendererChromium> layerRenderer; 553 layerRenderer = LayerRendererChromium::create(this, context , textureUploader);558 layerRenderer = LayerRendererChromium::create(this, context3d, textureUploader); 554 559 555 560 // Since we now have a new context/layerRenderer, we cannot continue to use the old … … 561 566 562 567 m_layerRenderer = layerRenderer.release(); 568 if (m_layerRenderer) 569 m_context = context; 563 570 564 571 if (!m_visible && m_layerRenderer) -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.h
r119178 r119313 64 64 65 65 // CCLayerTreeHostImpl owns the CCLayerImpl tree as well as associated rendering state 66 class CCLayerTreeHostImpl : public CCInputHandlerClient, LayerRendererChromiumClient {66 class CCLayerTreeHostImpl : public CCInputHandlerClient, CCRendererClient { 67 67 WTF_MAKE_NONCOPYABLE(CCLayerTreeHostImpl); 68 68 typedef Vector<CCLayerImpl*> CCLayerList; … … 104 104 void didDrawAllLayers(const FrameData&); 105 105 106 // LayerRendererChromiumClient implementation106 // CCRendererClient implementation 107 107 virtual const IntSize& deviceViewportSize() const OVERRIDE { return m_deviceViewportSize; } 108 108 virtual const CCSettings& settings() const OVERRIDE { return m_settings; } … … 114 114 // Implementation 115 115 bool canDraw(); 116 GraphicsContext3D* context();116 CCGraphicsContext* context(); 117 117 118 118 String layerTreeAsText() const; … … 122 122 int frameNumber() const { return m_frameNumber; } 123 123 124 bool initializeLayerRenderer(PassRefPtr< GraphicsContext3D>, TextureUploaderOption);124 bool initializeLayerRenderer(PassRefPtr<CCGraphicsContext>, TextureUploaderOption); 125 125 bool isContextLost(); 126 LayerRendererChromium* layerRenderer() { return m_layerRenderer.get(); }126 CCRenderer* layerRenderer() { return m_layerRenderer.get(); } 127 127 const LayerRendererCapabilities& layerRendererCapabilities() const; 128 128 TextureAllocator* contentsTextureAllocator() const; … … 210 210 void dumpRenderSurfaces(TextStream&, int indent, const CCLayerImpl*) const; 211 211 212 OwnPtr<LayerRendererChromium> m_layerRenderer; 212 RefPtr<CCGraphicsContext> m_context; 213 OwnPtr<CCRenderer> m_layerRenderer; 213 214 OwnPtr<CCLayerImpl> m_rootLayerImpl; 214 215 CCLayerImpl* m_scrollLayerImpl; -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCProxy.h
r118383 r119313 36 36 class CCFontAtlas; 37 37 class CCThread; 38 class GraphicsContext3D;38 class CCGraphicsContext; 39 39 struct LayerRendererCapabilities; 40 40 … … 114 114 115 115 // Temporary hack while render_widget still does scheduling for CCLayerTreeHostMainThreadI 116 virtual GraphicsContext3D* context() = 0;116 virtual CCGraphicsContext* context() = 0; 117 117 118 118 // Testing hooks -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCScrollbarLayerImpl.cpp
r115278 r119313 51 51 } 52 52 53 void CCScrollbarLayerImpl::willDraw( LayerRendererChromium* layerRenderer)54 { 55 CCLayerImpl::willDraw(layerRenderer );53 void CCScrollbarLayerImpl::willDraw(CCRenderer* layerRenderer, CCGraphicsContext* context) 54 { 55 CCLayerImpl::willDraw(layerRenderer, context); 56 56 57 57 if (bounds().isEmpty() || contentBounds().isEmpty()) … … 78 78 { 79 79 PlatformCanvas::AutoLocker locker(&canvas); 80 GraphicsContext3D* context = layerRenderer->context();81 80 m_texture->bindTexture(context, layerRenderer->renderSurfaceTextureAllocator()); 82 81 83 82 // FIXME: Skia uses BGRA actually, we correct that with the swizzle pixel shader. 84 GLC(context, context->texImage2D(GraphicsContext3D::TEXTURE_2D, 0, m_texture->format(), canvas.size().width(), canvas.size().height(), 0, GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE, locker.pixels())); 83 GraphicsContext3D* context3d = context->context3D(); 84 if (!context3d) { 85 // FIXME: Implement this path for software compositing. 86 return; 87 } 88 89 GLC(context3d, context3d->texImage2D(GraphicsContext3D::TEXTURE_2D, 0, m_texture->format(), canvas.size().width(), canvas.size().height(), 0, GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE, locker.pixels())); 85 90 } 86 91 } -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCScrollbarLayerImpl.h
r113902 r119313 60 60 void setScrollLayer(CCLayerImpl* scrollLayer) { m_scrollLayer = scrollLayer; } 61 61 62 virtual void willDraw( LayerRendererChromium*) OVERRIDE;62 virtual void willDraw(CCRenderer*, CCGraphicsContext*) OVERRIDE; 63 63 virtual void appendQuads(CCQuadCuller&, const CCSharedQuadState*, bool& hadMissingTiles) OVERRIDE; 64 64 virtual void didDraw() OVERRIDE; -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp
r119173 r119313 27 27 #include "cc/CCSingleThreadProxy.h" 28 28 29 #include "GraphicsContext3D.h"30 29 #include "LayerRendererChromium.h" 31 30 #include "TraceEvent.h" … … 113 112 } 114 113 115 GraphicsContext3D* CCSingleThreadProxy::context()114 CCGraphicsContext* CCSingleThreadProxy::context() 116 115 { 117 116 ASSERT(CCProxy::isMainThread()); … … 140 139 { 141 140 ASSERT(CCProxy::isMainThread()); 142 RefPtr< GraphicsContext3D> context = m_layerTreeHost->createContext();141 RefPtr<CCGraphicsContext> context = m_layerTreeHost->createContext(); 143 142 if (!context) 144 143 return false; … … 177 176 ASSERT(m_contextLost); 178 177 179 RefPtr< GraphicsContext3D> context = m_layerTreeHost->createContext();178 RefPtr<CCGraphicsContext> context = m_layerTreeHost->createContext(); 180 179 if (!context) 181 180 return false; -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.h
r119173 r119313 46 46 virtual bool compositeAndReadback(void *pixels, const IntRect&) OVERRIDE; 47 47 virtual void startPageScaleAnimation(const IntSize& targetPosition, bool useAnchor, float scale, double duration) OVERRIDE; 48 virtual GraphicsContext3D* context() OVERRIDE;48 virtual CCGraphicsContext* context() OVERRIDE; 49 49 virtual void finishAllRendering() OVERRIDE; 50 50 virtual bool isStarted() const OVERRIDE; … … 98 98 // Holds on to the context between initializeContext() and initializeLayerRenderer() calls. Shouldn't 99 99 // be used for anything else. 100 RefPtr< GraphicsContext3D> m_contextBeforeInitialization;100 RefPtr<CCGraphicsContext> m_contextBeforeInitialization; 101 101 102 102 OwnPtr<CCSingleThreadProxyAnimationTimer> m_animationTimer; -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCTextureUpdater.cpp
r116351 r119313 93 93 } 94 94 95 void CCTextureUpdater::update( GraphicsContext3D* context, TextureAllocator* allocator, TextureCopier* copier, TextureUploader* uploader, size_t count)95 void CCTextureUpdater::update(CCGraphicsContext* context, TextureAllocator* allocator, TextureCopier* copier, TextureUploader* uploader, size_t count) 96 96 { 97 97 size_t index; … … 143 143 // before letting the main thread proceed as it may make draw calls to the source texture of one of 144 144 // our copy operations. 145 if (m_copyEntries.size() || m_managedCopyEntries.size()) 146 context->flush(); 145 if (m_copyEntries.size() || m_managedCopyEntries.size()) { 146 GraphicsContext3D* context3d = context->context3D(); 147 if (context3d) 148 context3d->flush(); 149 // FIXME: Implement this path for software compositing. 150 } 147 151 148 152 // If no entries left to process, auto-clear. -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCTextureUpdater.h
r116351 r119313 33 33 namespace WebCore { 34 34 35 class GraphicsContext3D;36 35 class TextureAllocator; 37 36 class TextureCopier; … … 51 50 52 51 // Update some textures. 53 void update( GraphicsContext3D*, TextureAllocator*, TextureCopier*, TextureUploader*, size_t count);52 void update(CCGraphicsContext*, TextureAllocator*, TextureCopier*, TextureUploader*, size_t count); 54 53 55 54 void clear(); -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp
r118513 r119313 153 153 } 154 154 155 GraphicsContext3D* CCThreadProxy::context()155 CCGraphicsContext* CCThreadProxy::context() 156 156 { 157 157 return 0; … … 177 177 { 178 178 TRACE_EVENT("CCThreadProxy::initializeContext", this, 0); 179 RefPtr< GraphicsContext3D> context = m_layerTreeHost->createContext();179 RefPtr<CCGraphicsContext> context = m_layerTreeHost->createContext(); 180 180 if (!context) 181 181 return false; … … 183 183 184 184 // Leak the context pointer so we can transfer ownership of it to the other side... 185 GraphicsContext3D* contextPtr = context.release().leakRef();185 CCGraphicsContext* contextPtr = context.release().leakRef(); 186 186 ASSERT(contextPtr->hasOneRef()); 187 187 … … 230 230 231 231 // Try to create the context. 232 RefPtr< GraphicsContext3D> context = m_layerTreeHost->createContext();232 RefPtr<CCGraphicsContext> context = m_layerTreeHost->createContext(); 233 233 if (!context) 234 234 return false; 235 if (CCLayerTreeHost::needsFilterContext() )235 if (CCLayerTreeHost::needsFilterContext() && !m_layerTreeHost->settings().forceSoftwareCompositing) 236 236 if (!SharedGraphicsContext3D::createForImplThread()) 237 237 return false; … … 240 240 241 241 // Leak the context pointer so we can transfer ownership of it to the other side... 242 GraphicsContext3D* contextPtr = context.release().leakRef();242 CCGraphicsContext* contextPtr = context.release().leakRef(); 243 243 ASSERT(contextPtr->hasOneRef()); 244 244 … … 477 477 } 478 478 479 if (CCLayerTreeHost::needsFilterContext() && ! SharedGraphicsContext3D::haveForImplThread())479 if (CCLayerTreeHost::needsFilterContext() && !m_layerTreeHost->settings().forceSoftwareCompositing && !SharedGraphicsContext3D::haveForImplThread()) 480 480 SharedGraphicsContext3D::createForImplThread(); 481 481 … … 808 808 } 809 809 810 void CCThreadProxy::initializeContextOnImplThread( GraphicsContext3D* context)810 void CCThreadProxy::initializeContextOnImplThread(CCGraphicsContext* context) 811 811 { 812 812 TRACE_EVENT("CCThreadProxy::initializeContextOnImplThread", this, 0); … … 865 865 } 866 866 867 void CCThreadProxy::recreateContextOnImplThread(CCCompletionEvent* completion, GraphicsContext3D* contextPtr, bool* recreateSucceeded, LayerRendererCapabilities* capabilities)867 void CCThreadProxy::recreateContextOnImplThread(CCCompletionEvent* completion, CCGraphicsContext* contextPtr, bool* recreateSucceeded, LayerRendererCapabilities* capabilities) 868 868 { 869 869 TRACE_EVENT0("cc", "CCThreadProxy::recreateContextOnImplThread"); -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.h
r118383 r119313 54 54 virtual bool compositeAndReadback(void *pixels, const IntRect&) OVERRIDE; 55 55 virtual void startPageScaleAnimation(const IntSize& targetPosition, bool useAnchor, float scale, double duration) OVERRIDE; 56 virtual GraphicsContext3D* context() OVERRIDE;56 virtual CCGraphicsContext* context() OVERRIDE; 57 57 virtual void finishAllRendering() OVERRIDE; 58 58 virtual bool isStarted() const OVERRIDE; … … 137 137 void initializeImplOnImplThread(CCCompletionEvent*); 138 138 void setSurfaceReadyOnImplThread(); 139 void initializeContextOnImplThread( GraphicsContext3D*);139 void initializeContextOnImplThread(CCGraphicsContext*); 140 140 void initializeLayerRendererOnImplThread(CCCompletionEvent*, bool* initializeSucceeded, LayerRendererCapabilities*); 141 141 void layerTreeHostClosedOnImplThread(CCCompletionEvent*); 142 142 void setFullRootLayerDamageOnImplThread(); 143 143 void acquireLayerTexturesForMainThreadOnImplThread(CCCompletionEvent*); 144 void recreateContextOnImplThread(CCCompletionEvent*, GraphicsContext3D*, bool* recreateSucceeded, LayerRendererCapabilities*);144 void recreateContextOnImplThread(CCCompletionEvent*, CCGraphicsContext*, bool* recreateSucceeded, LayerRendererCapabilities*); 145 145 CCScheduledActionDrawAndSwapResult scheduledActionDrawAndSwapInternal(bool forcedDraw); 146 146 void setFontAtlasOnImplThread(PassOwnPtr<CCFontAtlas>); … … 169 169 RefPtr<CCScopedThreadProxy> m_mainThreadProxy; 170 170 171 // Holds on to the GraphicsContext3Dwe might use for compositing in between initializeContext()171 // Holds on to the context we might use for compositing in between initializeContext() 172 172 // and initializeLayerRenderer() calls. 173 RefPtr< GraphicsContext3D> m_contextBeforeInitializationOnImplThread;173 RefPtr<CCGraphicsContext> m_contextBeforeInitializationOnImplThread; 174 174 175 175 // Set when the main thread is waiting on a scheduledActionBeginFrame to be issued. -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCVideoLayerImpl.cpp
r116979 r119313 129 129 } 130 130 131 void CCVideoLayerImpl::willDraw( LayerRendererChromium* layerRenderer)131 void CCVideoLayerImpl::willDraw(CCRenderer* layerRenderer, CCGraphicsContext* context) 132 132 { 133 133 ASSERT(CCProxy::isImplThread()); 134 CCLayerImpl::willDraw(layerRenderer );134 CCLayerImpl::willDraw(layerRenderer, context); 135 135 136 136 // Explicitly lock and unlock the provider mutex so it can be held from … … 149 149 } 150 150 151 void CCVideoLayerImpl::willDrawInternal( LayerRendererChromium* layerRenderer)151 void CCVideoLayerImpl::willDrawInternal(CCRenderer* layerRenderer) 152 152 { 153 153 ASSERT(CCProxy::isImplThread()); … … 245 245 } 246 246 247 bool CCVideoLayerImpl::reserveTextures(const WebKit::WebVideoFrame& frame, GC3Denum format, LayerRendererChromium* layerRenderer)247 bool CCVideoLayerImpl::reserveTextures(const WebKit::WebVideoFrame& frame, GC3Denum format, CCRenderer* layerRenderer) 248 248 { 249 249 if (frame.planes() > MaxPlanes) -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCVideoLayerImpl.h
r115403 r119313 49 49 virtual ~CCVideoLayerImpl(); 50 50 51 virtual void willDraw( LayerRendererChromium*) OVERRIDE;51 virtual void willDraw(CCRenderer*, CCGraphicsContext*) OVERRIDE; 52 52 virtual void appendQuads(CCQuadCuller&, const CCSharedQuadState*, bool& hadMissingTiles) OVERRIDE; 53 53 virtual void didDraw() OVERRIDE; … … 82 82 virtual const char* layerTypeAsString() const OVERRIDE { return "VideoLayer"; } 83 83 84 void willDrawInternal( LayerRendererChromium*);85 bool reserveTextures(const WebKit::WebVideoFrame&, GC3Denum format, LayerRendererChromium*);84 void willDrawInternal(CCRenderer*); 85 bool reserveTextures(const WebKit::WebVideoFrame&, GC3Denum format, CCRenderer*); 86 86 87 87 // Guards the destruction of m_provider and the frame that it provides -
trunk/Source/WebKit/chromium/ChangeLog
r119311 r119313 1 2012-06-01 Alexandre Elias <aelias@google.com> 2 3 [chromium] Software compositor initialization and base classes 4 https://bugs.webkit.org/show_bug.cgi?id=87920 5 6 Reviewed by James Robinson. 7 8 Add a new setting to force software compositing. In this mode, 9 no GraphicsContext3D should ever be created. 10 11 * public/WebSettings.h: 12 * src/WebLayerTreeView.cpp: 13 (WebKit::WebLayerTreeView::Settings::operator CCSettings): 14 (WebKit::WebLayerTreeView::context): 15 * src/WebLayerTreeViewImpl.cpp: 16 * src/WebSettingsImpl.cpp: 17 (WebKit::WebSettingsImpl::WebSettingsImpl): 18 (WebKit::WebSettingsImpl::setForceSoftwareCompositing): 19 (WebKit): 20 * src/WebSettingsImpl.h: 21 (WebSettingsImpl): 22 (WebKit::WebSettingsImpl::forceSoftwareCompositing): 23 * src/WebViewImpl.cpp: 24 (WebKit::WebViewImpl::setIsAcceleratedCompositingActive): 25 (WebKit::WebViewImpl::createCompositorGraphicsContext3D): 26 (WebKit::WebViewImpl::createContext3D): 27 * tests/CCLayerTreeHostImplTest.cpp: 28 (WebKitTests::CCLayerTreeHostImplTest::createContext): 29 (WebKitTests::TEST_F): 30 * tests/CCLayerTreeHostTest.cpp: 31 (WTF::CCLayerTreeHostTestAtomicCommit::commitCompleteOnCCThread): 32 (WTF::CCLayerTreeHostTestAtomicCommit::drawLayersOnCCThread): 33 (WTF::CCLayerTreeHostTestAtomicCommitWithPartialUpdate::commitCompleteOnCCThread): 34 (WTF::CCLayerTreeHostTestAtomicCommitWithPartialUpdate::drawLayersOnCCThread): 35 * tests/CCTiledLayerTestCommon.cpp: 36 (WebKitTests::FakeLayerTextureUpdater::Texture::updateRect): 37 * tests/CCTiledLayerTestCommon.h: 38 (Texture): 39 (WebKitTests::FakeTextureCopier::copyTexture): 40 (WebKitTests::FakeTextureUploader::uploadTexture): 41 * tests/Canvas2DLayerChromiumTest.cpp: 42 (Canvas2DLayerChromiumTest::fullLifecycleTest): 43 * tests/FakeCCLayerTreeHostClient.h: 44 * tests/LayerRendererChromiumTest.cpp: 45 (FakeLayerRendererChromium::FakeLayerRendererChromium): 46 (LayerRendererChromiumTest::LayerRendererChromiumTest): 47 (LayerRendererChromiumTest): 48 (TEST): 49 * tests/TextureCopierTest.cpp: 50 * tests/TiledLayerChromiumTest.cpp: 51 (WTF::TEST): 52 1 53 2012-06-01 Sheriff Bot <webkit.review.bot@gmail.com> 2 54 -
trunk/Source/WebKit/chromium/public/WebSettings.h
r118707 r119313 115 115 virtual void setAcceleratedCompositingEnabled(bool) = 0; 116 116 virtual void setForceCompositingMode(bool) = 0; 117 virtual void setForceSoftwareCompositing(bool) = 0; 117 118 virtual void setMockScrollbarsEnabled(bool) = 0; 118 119 virtual void setAcceleratedCompositingFor3DTransformsEnabled(bool) = 0; … … 157 158 virtual void setSyncXHRInDocumentsEnabled(bool) = 0; 158 159 160 virtual bool forceSoftwareCompositing() const = 0; 161 159 162 protected: 160 163 ~WebSettings() { } -
trunk/Source/WebKit/chromium/src/WebLayerTreeView.cpp
r118563 r119313 42 42 CCSettings settings; 43 43 settings.acceleratePainting = acceleratePainting; 44 settings.forceSoftwareCompositing = forceSoftwareCompositing; 44 45 settings.showFPSCounter = showFPSCounter; 45 46 settings.showPlatformLayerTree = showPlatformLayerTree; … … 162 163 WebGraphicsContext3D* WebLayerTreeView::context() 163 164 { 164 return GraphicsContext3DPrivate::extractWebGraphicsContext3D(m_private->layerTreeHost()->context() );165 return GraphicsContext3DPrivate::extractWebGraphicsContext3D(m_private->layerTreeHost()->context()->context3D()); 165 166 } 166 167 -
trunk/Source/WebKit/chromium/src/WebLayerTreeViewImpl.cpp
r118563 r119313 55 55 virtual void layout() OVERRIDE { m_client->layout(); } 56 56 virtual void applyScrollAndScale(const WebCore::IntSize& scrollDelta, float pageScale) OVERRIDE { m_client->applyScrollAndScale(scrollDelta, pageScale); } 57 virtual PassRefPtr<WebCore::GraphicsContext3D> createContext () OVERRIDE57 virtual PassRefPtr<WebCore::GraphicsContext3D> createContext3D() OVERRIDE 58 58 { 59 59 OwnPtr<WebGraphicsContext3D> webContext = adoptPtr(m_client->createContext3D()); -
trunk/Source/WebKit/chromium/src/WebSettingsImpl.cpp
r118707 r119313 48 48 WebSettingsImpl::WebSettingsImpl(Settings* settings) 49 49 : m_settings(settings) 50 , m_forceSoftwareCompositing(false) 50 51 , m_showFPSCounter(false) 51 52 , m_showPlatformLayerTree(false) … … 389 390 } 390 391 392 void WebSettingsImpl::setForceSoftwareCompositing(bool enabled) 393 { 394 m_forceSoftwareCompositing = enabled; 395 } 396 391 397 void WebSettingsImpl::setMockScrollbarsEnabled(bool enabled) 392 398 { -
trunk/Source/WebKit/chromium/src/WebSettingsImpl.h
r118707 r119313 110 110 virtual void setAcceleratedCompositingEnabled(bool); 111 111 virtual void setForceCompositingMode(bool); 112 virtual void setForceSoftwareCompositing(bool); 112 113 virtual void setMockScrollbarsEnabled(bool); 113 114 virtual void setAcceleratedCompositingFor3DTransformsEnabled(bool); … … 159 160 WebSize defaultTileSize() const { return m_defaultTileSize; } 160 161 WebSize maxUntiledLayerSize() const { return m_maxUntiledLayerSize; } 162 virtual bool forceSoftwareCompositing() const { return m_forceSoftwareCompositing; } 161 163 162 164 private: 163 165 WebCore::Settings* m_settings; 166 bool m_forceSoftwareCompositing; 164 167 bool m_showFPSCounter; 165 168 bool m_showPlatformLayerTree; -
trunk/Source/WebKit/chromium/src/WebViewImpl.cpp
r119085 r119313 3448 3448 layerTreeViewSettings.showPlatformLayerTree = settingsImpl()->showPlatformLayerTree(); 3449 3449 layerTreeViewSettings.showPaintRects = settingsImpl()->showPaintRects(); 3450 layerTreeViewSettings.forceSoftwareCompositing = settings()->forceSoftwareCompositing(); 3450 3451 3451 3452 layerTreeViewSettings.perTilePainting = page()->settings()->perTileDrawingEnabled(); … … 3496 3497 PassOwnPtr<WebKit::WebGraphicsContext3D> WebViewImpl::createCompositorGraphicsContext3D() 3497 3498 { 3499 if (settings()->forceSoftwareCompositing()) 3500 CRASH(); 3501 3498 3502 // Explicitly disable antialiasing for the compositor. As of the time of 3499 3503 // this writing, the only platform that supported antialiasing for the … … 3519 3523 WebKit::WebGraphicsContext3D* WebViewImpl::createContext3D() 3520 3524 { 3525 if (settings()->forceSoftwareCompositing()) 3526 CRASH(); 3527 3521 3528 OwnPtr<WebKit::WebGraphicsContext3D> webContext; 3522 3529 -
trunk/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp
r116979 r119313 108 108 109 109 protected: 110 PassRefPtr< GraphicsContext3D> createContext()111 { 112 return GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(new FakeWebGraphicsContext3D()), GraphicsContext3D::RenderDirectlyToHostWindow);110 PassRefPtr<CCGraphicsContext> createContext() 111 { 112 return CCGraphicsContext::create3D(GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(new FakeWebGraphicsContext3D()), GraphicsContext3D::RenderDirectlyToHostWindow)); 113 113 } 114 114 … … 417 417 } 418 418 419 virtual void willDraw( LayerRendererChromium*)419 virtual void willDraw(CCRenderer*, CCGraphicsContext*) 420 420 { 421 421 m_willDrawCalled = true; … … 989 989 ReshapeTrackerContext* reshapeTracker = new ReshapeTrackerContext(); 990 990 RefPtr<GraphicsContext3D> context = GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(reshapeTracker), GraphicsContext3D::RenderDirectlyToHostWindow); 991 m_hostImpl->initializeLayerRenderer(context, UnthrottledUploader); 991 RefPtr<CCGraphicsContext> ccContext = CCGraphicsContext::create3D(context); 992 m_hostImpl->initializeLayerRenderer(ccContext, UnthrottledUploader); 992 993 993 994 CCLayerImpl* root = new FakeDrawableCCLayerImpl(1); … … 1032 1033 PartialSwapTrackerContext* partialSwapTracker = new PartialSwapTrackerContext(); 1033 1034 RefPtr<GraphicsContext3D> context = GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(partialSwapTracker), GraphicsContext3D::RenderDirectlyToHostWindow); 1035 RefPtr<CCGraphicsContext> ccContext = CCGraphicsContext::create3D(context); 1034 1036 1035 1037 // This test creates its own CCLayerTreeHostImpl, so … … 1038 1040 settings.partialSwapEnabled = true; 1039 1041 OwnPtr<CCLayerTreeHostImpl> layerTreeHostImpl = CCLayerTreeHostImpl::create(settings, this); 1040 layerTreeHostImpl->initializeLayerRenderer(c ontext, UnthrottledUploader);1042 layerTreeHostImpl->initializeLayerRenderer(ccContext, UnthrottledUploader); 1041 1043 layerTreeHostImpl->setViewportSize(IntSize(500, 500)); 1042 1044 … … 1152 1154 { 1153 1155 // The context initialization will fail, but we should still be able to call finishAllRendering() without any ill effects. 1154 m_hostImpl->initializeLayerRenderer( GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(new FakeWebGraphicsContext3DMakeCurrentFails), GraphicsContext3D::RenderDirectlyToHostWindow), UnthrottledUploader);1156 m_hostImpl->initializeLayerRenderer(CCGraphicsContext::create3D(GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(new FakeWebGraphicsContext3DMakeCurrentFails), GraphicsContext3D::RenderDirectlyToHostWindow)), UnthrottledUploader); 1155 1157 m_hostImpl->finishAllRendering(); 1156 1158 } … … 1357 1359 // Lose the context, replacing it with a StrictWebGraphicsContext3D, that 1358 1360 // will warn if any resource from the previous context gets used. 1359 m_hostImpl->initializeLayerRenderer( StrictWebGraphicsContext3D::createGraphicsContext(), UnthrottledUploader);1361 m_hostImpl->initializeLayerRenderer(CCGraphicsContext::create3D(StrictWebGraphicsContext3D::createGraphicsContext()), UnthrottledUploader); 1360 1362 EXPECT_TRUE(m_hostImpl->prepareToDraw(frame)); 1361 1363 m_hostImpl->drawLayers(frame); -
trunk/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp
r119311 r119313 296 296 } 297 297 298 virtual PassRefPtr<GraphicsContext3D> createContext () OVERRIDE298 virtual PassRefPtr<GraphicsContext3D> createContext3D() OVERRIDE 299 299 { 300 300 return m_testHooks->createContext(); … … 2155 2155 virtual void commitCompleteOnCCThread(CCLayerTreeHostImpl* impl) 2156 2156 { 2157 CompositorFakeWebGraphicsContext3DWithTextureTracking* context = static_cast<CompositorFakeWebGraphicsContext3DWithTextureTracking*>(GraphicsContext3DPrivate::extractWebGraphicsContext3D(impl->context() ));2157 CompositorFakeWebGraphicsContext3DWithTextureTracking* context = static_cast<CompositorFakeWebGraphicsContext3DWithTextureTracking*>(GraphicsContext3DPrivate::extractWebGraphicsContext3D(impl->context()->context3D())); 2158 2158 2159 2159 switch (impl->sourceFrameNumber()) { … … 2189 2189 virtual void drawLayersOnCCThread(CCLayerTreeHostImpl* impl) 2190 2190 { 2191 CompositorFakeWebGraphicsContext3DWithTextureTracking* context = static_cast<CompositorFakeWebGraphicsContext3DWithTextureTracking*>(GraphicsContext3DPrivate::extractWebGraphicsContext3D(impl->context() ));2191 CompositorFakeWebGraphicsContext3DWithTextureTracking* context = static_cast<CompositorFakeWebGraphicsContext3DWithTextureTracking*>(GraphicsContext3DPrivate::extractWebGraphicsContext3D(impl->context()->context3D())); 2192 2192 2193 2193 // Number of textures used for draw should always be one. … … 2259 2259 virtual void commitCompleteOnCCThread(CCLayerTreeHostImpl* impl) 2260 2260 { 2261 CompositorFakeWebGraphicsContext3DWithTextureTracking* context = static_cast<CompositorFakeWebGraphicsContext3DWithTextureTracking*>(GraphicsContext3DPrivate::extractWebGraphicsContext3D(impl->context() ));2261 CompositorFakeWebGraphicsContext3DWithTextureTracking* context = static_cast<CompositorFakeWebGraphicsContext3DWithTextureTracking*>(GraphicsContext3DPrivate::extractWebGraphicsContext3D(impl->context()->context3D())); 2262 2262 2263 2263 switch (impl->sourceFrameNumber()) { … … 2328 2328 virtual void drawLayersOnCCThread(CCLayerTreeHostImpl* impl) 2329 2329 { 2330 CompositorFakeWebGraphicsContext3DWithTextureTracking* context = static_cast<CompositorFakeWebGraphicsContext3DWithTextureTracking*>(GraphicsContext3DPrivate::extractWebGraphicsContext3D(impl->context() ));2330 CompositorFakeWebGraphicsContext3DWithTextureTracking* context = static_cast<CompositorFakeWebGraphicsContext3DWithTextureTracking*>(GraphicsContext3DPrivate::extractWebGraphicsContext3D(impl->context()->context3D())); 2331 2331 2332 2332 // Number of textures used for drawing should two except for frame 4 -
trunk/Source/WebKit/chromium/tests/CCTiledLayerTestCommon.cpp
r114827 r119313 41 41 } 42 42 43 void FakeLayerTextureUpdater::Texture::updateRect( GraphicsContext3D*, TextureAllocator* allocator, const IntRect&, const IntRect&)43 void FakeLayerTextureUpdater::Texture::updateRect(CCGraphicsContext*, TextureAllocator* allocator, const IntRect&, const IntRect&) 44 44 { 45 45 if (allocator) -
trunk/Source/WebKit/chromium/tests/CCTiledLayerTestCommon.h
r116351 r119313 26 26 #define CCTiledLayerTestCommon_h 27 27 28 #include "GraphicsContext3D.h"29 28 #include "IntRect.h" 30 29 #include "IntSize.h" … … 35 34 #include "TextureUploader.h" 36 35 #include "TiledLayerChromium.h" 36 #include "cc/CCGraphicsContext.h" 37 37 #include "cc/CCTextureUpdater.h" 38 38 #include "cc/CCTiledLayerImpl.h" … … 49 49 virtual ~Texture(); 50 50 51 virtual void updateRect(WebCore:: GraphicsContext3D*, WebCore::TextureAllocator* , const WebCore::IntRect&, const WebCore::IntRect&);51 virtual void updateRect(WebCore::CCGraphicsContext*, WebCore::TextureAllocator* , const WebCore::IntRect&, const WebCore::IntRect&); 52 52 virtual void prepareRect(const WebCore::IntRect&); 53 53 … … 157 157 class FakeTextureCopier : public WebCore::TextureCopier { 158 158 public: 159 virtual void copyTexture(WebCore:: GraphicsContext3D*, unsigned, unsigned, const WebCore::IntSize&) { }159 virtual void copyTexture(WebCore::CCGraphicsContext*, unsigned, unsigned, const WebCore::IntSize&) { } 160 160 }; 161 161 … … 165 165 virtual void beginUploads() { } 166 166 virtual void endUploads() { } 167 virtual void uploadTexture(WebCore:: GraphicsContext3D* context, WebCore::LayerTextureUpdater::Texture* texture, WebCore::TextureAllocator* allocator, const WebCore::IntRect sourceRect, const WebCore::IntRect destRect) { texture->updateRect(context, allocator, sourceRect, destRect); }167 virtual void uploadTexture(WebCore::CCGraphicsContext* context, WebCore::LayerTextureUpdater::Texture* texture, WebCore::TextureAllocator* allocator, const WebCore::IntRect sourceRect, const WebCore::IntRect destRect) { texture->updateRect(context, allocator, sourceRect, destRect); } 168 168 }; 169 169 -
trunk/Source/WebKit/chromium/tests/Canvas2DLayerChromiumTest.cpp
r116351 r119313 86 86 class MockTextureCopier : public TextureCopier { 87 87 public: 88 MOCK_METHOD4(copyTexture, void( GraphicsContext3D*, unsigned, unsigned, const IntSize&));88 MOCK_METHOD4(copyTexture, void(CCGraphicsContext*, unsigned, unsigned, const IntSize&)); 89 89 }; 90 90 … … 94 94 MOCK_METHOD0(beginUploads, void()); 95 95 MOCK_METHOD0(endUploads, void()); 96 MOCK_METHOD5(uploadTexture, void( GraphicsContext3D*, LayerTextureUpdater::Texture*, TextureAllocator*, const IntRect, const IntRect));96 MOCK_METHOD5(uploadTexture, void(CCGraphicsContext*, LayerTextureUpdater::Texture*, TextureAllocator*, const IntRect, const IntRect)); 97 97 }; 98 98 … … 106 106 107 107 RefPtr<GraphicsContext3D> mainContext = GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(new MockCanvasContext()), GraphicsContext3D::RenderDirectlyToHostWindow); 108 RefPtr<CCGraphicsContext> ccMainContext = CCGraphicsContext::create3D(mainContext); 108 109 RefPtr<GraphicsContext3D> implContext = GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(new MockCanvasContext()), GraphicsContext3D::RenderDirectlyToHostWindow); 110 RefPtr<CCGraphicsContext> ccImplContext = CCGraphicsContext::create3D(implContext); 109 111 110 112 MockCanvasContext& mainMock = *static_cast<MockCanvasContext*>(GraphicsContext3DPrivate::extractWebGraphicsContext3D(mainContext.get())); … … 141 143 EXPECT_CALL(allocatorMock, createTexture(size, GraphicsContext3D::RGBA)) 142 144 .WillOnce(Return(frontTextureId)); 143 EXPECT_CALL(copierMock, copyTexture( implContext.get(), backTextureId, frontTextureId, size));145 EXPECT_CALL(copierMock, copyTexture(ccImplContext.get(), backTextureId, frontTextureId, size)); 144 146 EXPECT_CALL(implMock, flush()); 145 147 … … 165 167 EXPECT_EQ(0u, static_cast<CCTextureLayerImpl*>(layerImpl.get())->textureId()); 166 168 167 updater.update( implContext.get(), &allocatorMock, &copierMock, &uploaderMock, 1);169 updater.update(ccImplContext.get(), &allocatorMock, &copierMock, &uploaderMock, 1); 168 170 canvas->pushPropertiesTo(layerImpl.get()); 169 171 -
trunk/Source/WebKit/chromium/tests/FakeCCLayerTreeHostClient.h
r118513 r119313 40 40 virtual void layout() OVERRIDE { } 41 41 virtual void applyScrollAndScale(const IntSize& scrollDelta, float pageScale) OVERRIDE { } 42 virtual PassRefPtr<GraphicsContext3D> createContext () OVERRIDE42 virtual PassRefPtr<GraphicsContext3D> createContext3D() OVERRIDE 43 43 { 44 44 GraphicsContext3D::Attributes attrs; -
trunk/Source/WebKit/chromium/tests/LayerRendererChromiumTest.cpp
r119160 r119313 62 62 }; 63 63 64 class Fake LayerRendererChromiumClient : public LayerRendererChromiumClient {65 public: 66 Fake LayerRendererChromiumClient()64 class FakeCCRendererClient : public CCRendererClient { 65 public: 66 FakeCCRendererClient() 67 67 : m_setFullRootLayerDamageCount(0) 68 68 , m_rootLayer(CCLayerImpl::create(1)) … … 71 71 } 72 72 73 // LayerRendererChromiumClient methods.73 // CCRendererClient methods. 74 74 virtual const IntSize& deviceViewportSize() const OVERRIDE { static IntSize fakeSize; return fakeSize; } 75 75 virtual const CCSettings& settings() const OVERRIDE { static CCSettings fakeSettings; return fakeSettings; } … … 92 92 class FakeLayerRendererChromium : public LayerRendererChromium { 93 93 public: 94 FakeLayerRendererChromium( LayerRendererChromiumClient* client, PassRefPtr<GraphicsContext3D> context) : LayerRendererChromium(client, context, UnthrottledUploader) { }94 FakeLayerRendererChromium(CCRendererClient* client, PassRefPtr<GraphicsContext3D> context) : LayerRendererChromium(client, context, UnthrottledUploader) { } 95 95 96 96 // LayerRendererChromium methods. … … 127 127 RefPtr<GraphicsContext3D> m_context; 128 128 FrameCountingMemoryAllocationSettingContext& m_mockContext; 129 Fake LayerRendererChromiumClient m_mockClient;129 FakeCCRendererClient m_mockClient; 130 130 FakeLayerRendererChromium m_layerRendererChromium; 131 131 }; … … 271 271 TEST(LayerRendererChromiumTest2, initializationDoesNotMakeSynchronousCalls) 272 272 { 273 Fake LayerRendererChromiumClient mockClient;273 FakeCCRendererClient mockClient; 274 274 FakeLayerRendererChromium layerRendererChromium(&mockClient, GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(new ForbidSynchronousCallContext), GraphicsContext3D::RenderDirectlyToHostWindow)); 275 275 … … 312 312 TEST(LayerRendererChromiumTest2, initializationWithQuicklyLostContextDoesNotAssert) 313 313 { 314 Fake LayerRendererChromiumClient mockClient;314 FakeCCRendererClient mockClient; 315 315 FakeLayerRendererChromium layerRendererChromium(&mockClient, GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(new LoseContextOnFirstGetContext), GraphicsContext3D::RenderDirectlyToHostWindow)); 316 316 -
trunk/Source/WebKit/chromium/tests/TextureCopierTest.cpp
r112286 r119313 55 55 RefPtr<GraphicsContext3D> context = GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(new MockContext()), GraphicsContext3D::RenderDirectlyToHostWindow); 56 56 MockContext& mockContext = *static_cast<MockContext*>(GraphicsContext3DPrivate::extractWebGraphicsContext3D(context.get())); 57 RefPtr<CCGraphicsContext> ccContext = CCGraphicsContext::create3D(context); 57 58 58 59 { … … 80 81 IntSize size(256, 128); 81 82 OwnPtr<AcceleratedTextureCopier> copier(AcceleratedTextureCopier::create(context)); 82 copier->copyTexture(c ontext.get(), sourceTextureId, destTextureId, size);83 copier->copyTexture(ccContext.get(), sourceTextureId, destTextureId, size); 83 84 } 84 85 -
trunk/Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp
r119178 r119313 674 674 FakeTextureUploader fakeUploader; 675 675 RefPtr<GraphicsContext3D> context = createCompositorMockGraphicsContext3D(GraphicsContext3D::Attributes()); 676 RefPtr<CCGraphicsContext> ccContext = CCGraphicsContext::create3D(context); 676 677 677 678 // The tile size is 100x100, so this invalidates and then paints two tiles. … … 679 680 layer->invalidateRect(IntRect(0, 0, 100, 200)); 680 681 layer->updateLayerRect(updater, IntRect(0, 0, 100, 200), 0); 681 updater.update(c ontext.get(), &fakeAllocator, &fakeCopier, &fakeUploader, 1000);682 updater.update(ccContext.get(), &fakeAllocator, &fakeCopier, &fakeUploader, 1000); 682 683 layer->pushPropertiesTo(layerImpl.get()); 683 684 … … 692 693 // the LayerTextureUpdater. 693 694 layer->updateLayerRect(updater, IntRect(0, 0, 100, 200), 0); 694 updater.update(c ontext.get(), &fakeAllocator, &fakeCopier, &fakeUploader, 1000);695 updater.update(ccContext.get(), &fakeAllocator, &fakeCopier, &fakeUploader, 1000); 695 696 EXPECT_EQ(0, layer->fakeLayerTextureUpdater()->prepareCount()); 696 697 … … 700 701 layer->fakeLayerTextureUpdater()->clearPrepareCount(); 701 702 layer->updateLayerRect(updater, IntRect(0, 0, 100, 200), 0); 702 updater.update(c ontext.get(), &fakeAllocator, &fakeCopier, &fakeUploader, 1000);703 updater.update(ccContext.get(), &fakeAllocator, &fakeCopier, &fakeUploader, 1000); 703 704 EXPECT_EQ(1, layer->fakeLayerTextureUpdater()->prepareCount()); 704 705 layer->fakeLayerTextureUpdater()->clearPrepareCount(); 705 706 // The layer should still be invalid as updateLayerRect invoked invalidate. 706 707 layer->updateLayerRect(updater, IntRect(0, 0, 100, 200), 0); 707 updater.update(c ontext.get(), &fakeAllocator, &fakeCopier, &fakeUploader, 1000);708 updater.update(ccContext.get(), &fakeAllocator, &fakeCopier, &fakeUploader, 1000); 708 709 EXPECT_EQ(1, layer->fakeLayerTextureUpdater()->prepareCount()); 709 710 }
Note: See TracChangeset
for help on using the changeset viewer.