Changeset 79659 in webkit
- Timestamp:
- Feb 24, 2011 7:20:12 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r79656 r79659 1 2011-02-24 James Robinson <jamesr@chromium.org> 2 3 Reviewed by Kenneth Russell. 4 5 [chromium] Move draw time properties out of *LayerChromium to CCLayerImpl 6 https://bugs.webkit.org/show_bug.cgi?id=55013 7 8 This adds a new type (tentatively named CCLayerImpl) responsible for drawing/compositing layers. 9 Currently LayerChromiums know about their CCLayerImpls and CCLayerImpls rely on the LayerChromium 10 tree for structure. In theory updates are a LayerChromium-only concept and draw is a CCLayerImpl-only 11 concept, but this patch doesn't go all there yet in the interest of keeping the patch small-ish. 12 13 RenderSurfaces are a CCLayerImpl-only concepts and no longer have any direct LayerChromium dependencies. 14 15 Note: I've put CCLayerImpl into a new 'cc' directory under platform/graphics/chromium/ and intentionally 16 not added it to the include path. We plan to add more compositor implementation details to this directory 17 and we want to keep accidental dependencies on these files to a minimum. 18 19 See https://bugs.webkit.org/show_bug.cgi?id=54047 for the big picture. 20 21 Refactor only, compositing/ tests cover these codepaths. 22 23 * WebCore.gypi: 24 * platform/graphics/chromium/CanvasLayerChromium.cpp: 25 (WebCore::CanvasLayerChromium::draw): 26 * platform/graphics/chromium/ContentLayerChromium.cpp: 27 (WebCore::ContentLayerChromium::requiresClippedUpdateRect): 28 (WebCore::ContentLayerChromium::updateContentsIfDirty): 29 (WebCore::ContentLayerChromium::draw): 30 * platform/graphics/chromium/LayerChromium.cpp: 31 (WebCore::LayerChromium::LayerChromium): 32 (WebCore::LayerChromium::cleanupResources): 33 (WebCore::LayerChromium::setLayerRenderer): 34 (WebCore::LayerChromium::setBounds): 35 (WebCore::LayerChromium::setFrame): 36 (WebCore::LayerChromium::setNeedsDisplay): 37 (WebCore::LayerChromium::setBorderColor): 38 (WebCore::LayerChromium::borderColor): 39 (WebCore::LayerChromium::setBorderWidth): 40 (WebCore::LayerChromium::borderWidth): 41 (WebCore::LayerChromium::layerRenderer): 42 (WebCore::LayerChromium::setDoubleSided): 43 (WebCore::LayerChromium::bounds): 44 * platform/graphics/chromium/LayerChromium.h: 45 (WebCore::LayerChromium::maskDrawLayer): 46 (WebCore::LayerChromium::ccLayerImpl): 47 * platform/graphics/chromium/LayerRendererChromium.cpp: 48 (WebCore::LayerRendererChromium::compareLayerZ): 49 (WebCore::LayerRendererChromium::drawLayers): 50 (WebCore::LayerRendererChromium::updateLayersRecursive): 51 (WebCore::LayerRendererChromium::setCompositeOffscreen): 52 (WebCore::LayerRendererChromium::getOffscreenLayerTexture): 53 (WebCore::LayerRendererChromium::drawLayer): 54 * platform/graphics/chromium/LayerRendererChromium.h: 55 * platform/graphics/chromium/PluginLayerChromium.cpp: 56 (WebCore::PluginLayerChromium::draw): 57 * platform/graphics/chromium/RenderSurfaceChromium.cpp: 58 (WebCore::RenderSurfaceChromium::RenderSurfaceChromium): 59 (WebCore::RenderSurfaceChromium::drawSurface): 60 (WebCore::RenderSurfaceChromium::draw): 61 * platform/graphics/chromium/RenderSurfaceChromium.h: 62 * platform/graphics/chromium/VideoLayerChromium.cpp: 63 (WebCore::VideoLayerChromium::drawYUV): 64 (WebCore::VideoLayerChromium::drawRGBA): 65 * platform/graphics/chromium/cc/CCLayerImpl.cpp: Added. 66 (WebCore::CCLayerImpl::CCLayerImpl): 67 (WebCore::CCLayerImpl::~CCLayerImpl): 68 (WebCore::CCLayerImpl::superlayer): 69 (WebCore::CCLayerImpl::maskLayer): 70 (WebCore::CCLayerImpl::replicaLayer): 71 (WebCore::CCLayerImpl::setLayerRenderer): 72 (WebCore::CCLayerImpl::createRenderSurface): 73 (WebCore::CCLayerImpl::updateContentsIfDirty): 74 (WebCore::CCLayerImpl::drawsContent): 75 (WebCore::CCLayerImpl::draw): 76 (WebCore::CCLayerImpl::unreserveContentsTexture): 77 (WebCore::CCLayerImpl::bindContentsTexture): 78 (WebCore::CCLayerImpl::cleanupResources): 79 (WebCore::CCLayerImpl::getDrawRect): 80 (WebCore::CCLayerImpl::drawDebugBorder): 81 * platform/graphics/chromium/cc/CCLayerImpl.h: Added. 82 (WebCore::CCLayerImpl::create): 83 (WebCore::CCLayerImpl::setDebugBorderColor): 84 (WebCore::CCLayerImpl::debugBorderColor): 85 (WebCore::CCLayerImpl::setDebugBorderWidth): 86 (WebCore::CCLayerImpl::debugBorderWidth): 87 (WebCore::CCLayerImpl::layerRenderer): 88 (WebCore::CCLayerImpl::renderSurface): 89 (WebCore::CCLayerImpl::clearRenderSurface): 90 (WebCore::CCLayerImpl::drawDepth): 91 (WebCore::CCLayerImpl::setDrawDepth): 92 (WebCore::CCLayerImpl::drawOpacity): 93 (WebCore::CCLayerImpl::setDrawOpacity): 94 (WebCore::CCLayerImpl::scissorRect): 95 (WebCore::CCLayerImpl::setScissorRect): 96 (WebCore::CCLayerImpl::targetRenderSurface): 97 (WebCore::CCLayerImpl::setTargetRenderSurface): 98 (WebCore::CCLayerImpl::doubleSided): 99 (WebCore::CCLayerImpl::setDoubleSided): 100 (WebCore::CCLayerImpl::bounds): 101 (WebCore::CCLayerImpl::setBounds): 102 (WebCore::CCLayerImpl::drawTransform): 103 (WebCore::CCLayerImpl::setDrawTransform): 104 (WebCore::CCLayerImpl::drawableContentRect): 105 (WebCore::CCLayerImpl::setDrawableContentRect): 106 1 107 2011-02-24 Dan Bernstein <mitz@apple.com> 2 108 -
trunk/Source/WebCore/WebCore.gypi
r79616 r79659 2598 2598 'platform/graphics/chromium/FontUtilsChromiumWin.cpp', 2599 2599 'platform/graphics/chromium/FontUtilsChromiumWin.h', 2600 'platform/graphics/chromium/GLES2Canvas.cpp', 2601 'platform/graphics/chromium/GLES2Canvas.h', 2600 2602 'platform/graphics/chromium/GeometryBinding.cpp', 2601 2603 'platform/graphics/chromium/GeometryBinding.h', 2602 'platform/graphics/chromium/GLES2Canvas.cpp',2603 'platform/graphics/chromium/GLES2Canvas.h',2604 2604 'platform/graphics/chromium/GlyphPageTreeNodeChromiumWin.cpp', 2605 2605 'platform/graphics/chromium/GraphicsLayerChromium.cpp', … … 2627 2627 'platform/graphics/chromium/ProgramBinding.cpp', 2628 2628 'platform/graphics/chromium/ProgramBinding.h', 2629 'platform/graphics/chromium/RenderSurfaceChromium.cpp', 2629 2630 'platform/graphics/chromium/RenderSurfaceChromium.h', 2630 'platform/graphics/chromium/RenderSurfaceChromium.cpp',2631 2631 'platform/graphics/chromium/ShaderChromium.cpp', 2632 2632 'platform/graphics/chromium/ShaderChromium.h', … … 2641 2641 'platform/graphics/chromium/UniscribeHelperTextRun.cpp', 2642 2642 'platform/graphics/chromium/UniscribeHelperTextRun.h', 2643 'platform/graphics/chromium/VDMXParser.cpp', 2644 'platform/graphics/chromium/VDMXParser.h', 2643 2645 'platform/graphics/chromium/VideoFrameChromium.cpp', 2644 2646 'platform/graphics/chromium/VideoFrameChromium.h', 2645 2647 'platform/graphics/chromium/VideoLayerChromium.cpp', 2646 2648 'platform/graphics/chromium/VideoLayerChromium.h', 2647 'platform/graphics/chromium/VDMXParser.cpp',2648 'platform/graphics/chromium/VDMXParser.h',2649 2649 'platform/graphics/chromium/WebGLLayerChromium.cpp', 2650 2650 'platform/graphics/chromium/WebGLLayerChromium.h', 2651 'platform/graphics/chromium/cc/CCLayerImpl.cpp', 2652 'platform/graphics/chromium/cc/CCLayerImpl.h', 2651 2653 'platform/graphics/cocoa/FontPlatformData.h', 2652 2654 'platform/graphics/cocoa/FontPlatformDataCocoa.mm', -
trunk/Source/WebCore/platform/graphics/chromium/CanvasLayerChromium.cpp
r79043 r79659 35 35 #include "CanvasLayerChromium.h" 36 36 37 #include "cc/CCLayerImpl.h" 37 38 #include "GraphicsContext3D.h" 38 39 #include "LayerRendererChromium.h" … … 63 64 layerRenderer()->useShader(program->program()); 64 65 GLC(context, context->uniform1i(program->fragmentShader().samplerLocation(), 0)); 65 drawTexturedQuad(context, layerRenderer()->projectionMatrix(), drawTransform(),66 bounds().width(), bounds().height(), drawOpacity(),66 drawTexturedQuad(context, layerRenderer()->projectionMatrix(), ccLayerImpl()->drawTransform(), 67 bounds().width(), bounds().height(), ccLayerImpl()->drawOpacity(), 67 68 program->vertexShader().matrixLocation(), 68 69 program->fragmentShader().alphaLocation()); 69 70 70 } 71 71 -
trunk/Source/WebCore/platform/graphics/chromium/ContentLayerChromium.cpp
r79578 r79659 35 35 #include "ContentLayerChromium.h" 36 36 37 #include "cc/CCLayerImpl.h" 37 38 #include "GraphicsContext3D.h" 38 39 #include "LayerRendererChromium.h" … … 80 81 // surface it's rendering into. This is a temporary measure until layer tiling is implemented. 81 82 static const int maxLayerSize = 2000; 82 return (bounds().width() > max(maxLayerSize, m_targetRenderSurface->contentRect().width())83 || bounds().height() > max(maxLayerSize, m_targetRenderSurface->contentRect().height())83 return (bounds().width() > max(maxLayerSize, ccLayerImpl()->targetRenderSurface()->contentRect().width()) 84 || bounds().height() > max(maxLayerSize, ccLayerImpl()->targetRenderSurface()->contentRect().height()) 84 85 || !layerRenderer()->checkTextureSize(bounds())); 85 86 } … … 104 105 // of texels to be repainted, so ignore these layers until tiling is 105 106 // implemented. 106 if (! drawTransform().isIdentityOrTranslation()) {107 if (!ccLayerImpl()->drawTransform().isIdentityOrTranslation()) { 107 108 m_skipsDraw = true; 108 109 return; … … 110 111 111 112 // Calculate the region of this layer that is currently visible. 112 const IntRect clipRect = m_targetRenderSurface->contentRect();113 114 TransformationMatrix layerOriginTransform = drawTransform();113 const IntRect clipRect = ccLayerImpl()->targetRenderSurface()->contentRect(); 114 115 TransformationMatrix layerOriginTransform = ccLayerImpl()->drawTransform(); 115 116 layerOriginTransform.translate3d(-0.5 * bounds().width(), -0.5 * bounds().height(), 0); 116 117 … … 342 343 343 344 if (requiresClippedUpdateRect()) { 344 float m43 = drawTransform().m43();345 float m43 = ccLayerImpl()->drawTransform().m43(); 345 346 TransformationMatrix transform; 346 347 transform.translate3d(m_layerCenterInSurfaceCoords.x(), m_layerCenterInSurfaceCoords.y(), m43); 347 348 drawTexturedQuad(context, layerRenderer()->projectionMatrix(), 348 349 transform, m_visibleRectInLayerCoords.width(), 349 m_visibleRectInLayerCoords.height(), drawOpacity(),350 m_visibleRectInLayerCoords.height(), ccLayerImpl()->drawOpacity(), 350 351 program->vertexShader().matrixLocation(), 351 352 program->fragmentShader().alphaLocation()); 352 353 } else { 353 354 drawTexturedQuad(context, layerRenderer()->projectionMatrix(), 354 drawTransform(), bounds().width(), bounds().height(),355 drawOpacity(), program->vertexShader().matrixLocation(),355 ccLayerImpl()->drawTransform(), bounds().width(), bounds().height(), 356 ccLayerImpl()->drawOpacity(), program->vertexShader().matrixLocation(), 356 357 program->fragmentShader().alphaLocation()); 357 358 } -
trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp
r79578 r79659 35 35 #include "LayerChromium.h" 36 36 37 #include "cc/CCLayerImpl.h" 37 38 #include "GraphicsContext3D.h" 38 39 #include "LayerRendererChromium.h" … … 58 59 , m_contentsDirty(false) 59 60 , m_maskLayer(0) 60 , m_targetRenderSurface(0)61 61 , m_superlayer(0) 62 62 , m_anchorPoint(0.5, 0.5) 63 63 , m_backgroundColor(0, 0, 0, 0) 64 , m_borderColor(0, 0, 0, 0)65 64 , m_opacity(1.0) 66 65 , m_zPosition(0.0) 67 66 , m_anchorPointZ(0) 68 , m_borderWidth(0)69 67 , m_clearsContext(false) 70 , m_doubleSided(true)71 68 , m_hidden(false) 72 69 , m_masksToBounds(false) … … 74 71 , m_geometryFlipped(false) 75 72 , m_needsDisplayOnBoundsChange(false) 76 , m_drawDepth(0) 77 , m_layerRenderer(0) 78 , m_renderSurface(0) 73 , m_ccLayerImpl(CCLayerImpl::create(this)) 79 74 , m_replicaLayer(0) 80 75 { … … 93 88 void LayerChromium::cleanupResources() 94 89 { 95 if (m_renderSurface) 96 m_renderSurface->cleanupResources(); 90 m_ccLayerImpl->cleanupResources(); 97 91 } 98 92 … … 106 100 } 107 101 108 m_layerRenderer = renderer; 109 } 110 111 RenderSurfaceChromium* LayerChromium::createRenderSurface() 112 { 113 m_renderSurface = new RenderSurfaceChromium(this); 114 return m_renderSurface.get(); 102 m_ccLayerImpl->setLayerRenderer(renderer); 115 103 } 116 104 … … 189 177 void LayerChromium::setBounds(const IntSize& size) 190 178 { 191 if ( m_bounds== size)192 return; 193 194 bool firstResize = ! m_bounds.width() && !m_bounds.height() && size.width() && size.height();195 196 m_ bounds = size;179 if (bounds() == size) 180 return; 181 182 bool firstResize = !bounds().width() && !bounds().height() && size.width() && size.height(); 183 184 m_ccLayerImpl->setBounds(size); 197 185 198 186 if (firstResize) 199 setNeedsDisplay(FloatRect(0, 0, m_bounds.width(), m_bounds.height()));187 setNeedsDisplay(FloatRect(0, 0, bounds().width(), bounds().height())); 200 188 else 201 189 setNeedsCommit(); … … 208 196 209 197 m_frame = rect; 210 setNeedsDisplay(FloatRect(0, 0, m_bounds.width(), m_bounds.height()));198 setNeedsDisplay(FloatRect(0, 0, bounds().width(), bounds().height())); 211 199 } 212 200 … … 257 245 { 258 246 m_dirtyRect.setLocation(FloatPoint()); 259 m_dirtyRect.setSize( m_bounds);247 m_dirtyRect.setSize(bounds()); 260 248 m_contentsDirty = true; 261 249 setNeedsCommit(); … … 316 304 } 317 305 318 void LayerChromium::drawDebugBorder() 319 { 320 static float glMatrix[16]; 321 if (!borderColor().alpha()) 322 return; 323 324 ASSERT(layerRenderer()); 325 const BorderProgram* program = layerRenderer()->borderProgram(); 326 ASSERT(program && program->initialized()); 327 layerRenderer()->useShader(program->program()); 328 TransformationMatrix renderMatrix = drawTransform(); 329 renderMatrix.scale3d(bounds().width(), bounds().height(), 1); 330 toGLMatrix(&glMatrix[0], layerRenderer()->projectionMatrix() * renderMatrix); 331 GraphicsContext3D* context = layerRendererContext(); 332 GLC(context, context->uniformMatrix4fv(program->vertexShader().matrixLocation(), false, &glMatrix[0], 1)); 333 334 GLC(context, context->uniform4f(program->fragmentShader().colorLocation(), borderColor().red() / 255.0, borderColor().green() / 255.0, borderColor().blue() / 255.0, 1)); 335 336 GLC(context, context->lineWidth(borderWidth())); 337 338 // The indices for the line are stored in the same array as the triangle indices. 339 GLC(context, context->drawElements(GraphicsContext3D::LINE_LOOP, 4, GraphicsContext3D::UNSIGNED_SHORT, 6 * sizeof(unsigned short))); 340 } 341 342 const IntRect LayerChromium::getDrawRect() const 343 { 344 // Form the matrix used by the shader to map the corners of the layer's 345 // bounds into the view space. 346 FloatRect layerRect(-0.5 * bounds().width(), -0.5 * bounds().height(), bounds().width(), bounds().height()); 347 IntRect mappedRect = enclosingIntRect(drawTransform().mapRect(layerRect)); 348 return mappedRect; 349 } 306 350 307 351 308 // Returns true if any of the layer's descendants has drawable content. … … 372 329 } 373 330 331 // Begin calls that forward to the CCLayerImpl. 332 // ============================================== 333 // These exists just for debugging (via drawDebugBorder()). 334 void LayerChromium::setBorderColor(const Color& color) 335 { 336 m_ccLayerImpl->setDebugBorderColor(color); 337 setNeedsCommit(); 338 } 339 340 Color LayerChromium::borderColor() const 341 { 342 return m_ccLayerImpl->debugBorderColor(); 343 } 344 345 void LayerChromium::setBorderWidth(float width) 346 { 347 m_ccLayerImpl->setDebugBorderWidth(width); 348 setNeedsCommit(); 349 } 350 351 float LayerChromium::borderWidth() const 352 { 353 return m_ccLayerImpl->debugBorderWidth(); 354 } 355 356 LayerRendererChromium* LayerChromium::layerRenderer() const 357 { 358 return m_ccLayerImpl->layerRenderer(); 359 } 360 361 void LayerChromium::setDoubleSided(bool doubleSided) 362 { 363 m_ccLayerImpl->setDoubleSided(doubleSided); 364 setNeedsCommit(); 365 } 366 367 const IntSize& LayerChromium::bounds() const 368 { 369 return m_ccLayerImpl->bounds(); 370 } 371 // ============================================== 372 // End calls that forward to the CCLayerImpl. 373 374 374 } 375 375 #endif // USE(ACCELERATED_COMPOSITING) -
trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.h
r79043 r79659 43 43 #include "ShaderChromium.h" 44 44 #include "TransformationMatrix.h" 45 45 46 #include <wtf/OwnPtr.h> 46 47 #include <wtf/PassRefPtr.h> … … 56 57 namespace WebCore { 57 58 59 class CCLayerImpl; 58 60 class GraphicsContext3D; 59 61 class LayerRendererChromium; … … 62 64 // this class. 63 65 class LayerChromium : public RefCounted<LayerChromium> { 64 friend class Layer RendererChromium;66 friend class LayerTilerChromium; 65 67 public: 66 68 static PassRefPtr<LayerChromium> create(GraphicsLayerChromium* owner = 0); … … 87 89 Color backgroundColor() const { return m_backgroundColor; } 88 90 89 void setBorderColor(const Color& color) { m_borderColor = color; setNeedsCommit(); }90 Color borderColor() const { return m_borderColor; }91 92 void setBorderWidth(float width) { m_borderWidth = width; setNeedsCommit(); }93 float borderWidth() const { return m_borderWidth; }94 95 void setBounds(const IntSize&);96 IntSize bounds() const { return m_bounds; }97 98 91 void setClearsContext(bool clears) { m_clearsContext = clears; setNeedsCommit(); } 99 92 bool clearsContext() const { return m_clearsContext; } 100 93 101 void setDoubleSided(bool doubleSided) { m_doubleSided = doubleSided; setNeedsCommit(); }102 bool doubleSided() const { return m_doubleSided; }103 104 94 void setFrame(const FloatRect&); 105 95 FloatRect frame() const { return m_frame; } … … 115 105 116 106 void setMaskLayer(LayerChromium* maskLayer) { m_maskLayer = maskLayer; } 107 CCLayerImpl* maskDrawLayer() const { return m_maskLayer ? m_maskLayer->ccLayerImpl() : 0; } 117 108 LayerChromium* maskLayer() const { return m_maskLayer.get(); } 118 109 … … 146 137 bool geometryFlipped() const { return m_geometryFlipped; } 147 138 148 const TransformationMatrix& drawTransform() const { return m_drawTransform; }149 float drawOpacity() const { return m_drawOpacity; }150 151 139 bool preserves3D() { return m_owner && m_owner->preserves3D(); } 152 140 … … 155 143 virtual void setLayerRenderer(LayerRendererChromium*); 156 144 145 // Returns true if any of the layer's descendants has content to draw. 146 bool descendantsDrawContent(); 147 157 148 void setOwner(GraphicsLayerChromium* owner) { m_owner = owner; } 158 149 159 150 void setReplicaLayer(LayerChromium* layer) { m_replicaLayer = layer; } 160 151 LayerChromium* replicaLayer() { return m_replicaLayer; } 161 162 // Returns the rect containtaining this layer in the current view's coordinate system.163 const IntRect getDrawRect() const;164 152 165 153 // These methods typically need to be overwritten by derived classes. … … 170 158 virtual void draw() { } 171 159 172 void drawDebugBorder(); 173 174 RenderSurfaceChromium* createRenderSurface(); 175 176 LayerRendererChromium* layerRenderer() const { return m_layerRenderer.get(); } 177 178 static void toGLMatrix(float*, const TransformationMatrix&); 160 // These exists just for debugging (via drawDebugBorder()). 161 void setBorderColor(const Color&); 162 Color borderColor() const; 163 164 void setBorderWidth(float); 165 float borderWidth() const; 166 167 // Everything from here down in the public section will move to CCLayerImpl. 168 169 CCLayerImpl* ccLayerImpl() const { return m_ccLayerImpl.get(); } 179 170 180 171 static void drawTexturedQuad(GraphicsContext3D*, const TransformationMatrix& projectionMatrix, const TransformationMatrix& layerMatrix, … … 182 173 int matrixLocation, int alphaLocation); 183 174 175 // Begin calls that forward to the CCLayerImpl. 176 LayerRendererChromium* layerRenderer() const; 177 void setDoubleSided(bool); 178 void setBounds(const IntSize&); 179 const IntSize& bounds() const; 180 // End calls that forward to the CCLayerImpl. 181 184 182 typedef ProgramBinding<VertexShaderPos, FragmentShaderColor> BorderProgram; 185 183 protected: 186 184 GraphicsLayerChromium* m_owner; 187 LayerChromium(GraphicsLayerChromium* owner);185 explicit LayerChromium(GraphicsLayerChromium* owner); 188 186 189 187 // This is called to clean up resources being held in the same context as … … 194 192 GraphicsContext3D* layerRendererContext() const; 195 193 196 // Returns true if any of the layer's descendants has content to draw. 197 bool descendantsDrawContent(); 198 199 IntSize m_bounds; 194 static void toGLMatrix(float*, const TransformationMatrix&); 195 200 196 FloatRect m_dirtyRect; 201 197 bool m_contentsDirty; … … 203 199 RefPtr<LayerChromium> m_maskLayer; 204 200 205 // Render surface this layer draws into. This is a surface that can belong206 // either to this layer (if m_targetRenderSurface == m_renderSurface) or207 // to an ancestor of this layer. The target render surface determines the208 // coordinate system the layer's transforms are relative to.209 RenderSurfaceChromium* m_targetRenderSurface;201 // All layer shaders share the same attribute locations for the vertex positions 202 // and texture coordinates. This allows switching shaders without rebinding attribute 203 // arrays. 204 static const unsigned s_positionAttribLocation; 205 static const unsigned s_texCoordAttribLocation; 210 206 211 207 private: … … 234 230 FloatPoint m_anchorPoint; 235 231 Color m_backgroundColor; 236 Color m_borderColor;237 232 float m_opacity; 238 233 float m_zPosition; 239 234 float m_anchorPointZ; 240 float m_borderWidth;241 float m_drawOpacity;242 235 bool m_clearsContext; 243 bool m_doubleSided;244 236 bool m_hidden; 245 237 bool m_masksToBounds; … … 248 240 bool m_needsDisplayOnBoundsChange; 249 241 250 // The global depth value of the center of the layer. This value is used251 // to sort layers from back to front.252 float m_drawDepth;253 254 // Points to the layer renderer that updates and draws this layer.255 RefPtr<LayerRendererChromium> m_layerRenderer;256 257 FloatRect m_frame;258 242 TransformationMatrix m_transform; 259 243 TransformationMatrix m_sublayerTransform; 260 TransformationMatrix m_drawTransform; 261 262 // The scissor rectangle that should be used when this layer is drawn. 263 // Inherited by the parent layer and further restricted if this layer masks 264 // to bounds. 265 IntRect m_scissorRect; 266 267 // Render surface associated with this layer. The layer and its descendants 268 // will render to this surface. 269 OwnPtr<RenderSurfaceChromium> m_renderSurface; 270 271 // Hierarchical bounding rect containing the layer and its descendants. 272 IntRect m_drawableContentRect; 244 245 FloatRect m_frame; 246 // For now, the LayerChromium directly owns its CCLayerImpl. 247 RefPtr<CCLayerImpl> m_ccLayerImpl; 273 248 274 249 // Replica layer used for reflections. -
trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
r79578 r79659 43 43 #include "TextureManager.h" 44 44 #include "WebGLLayerChromium.h" 45 #include "cc/CCLayerImpl.h" 45 46 #if USE(SKIA) 46 47 #include "NativeImageSkia.h" … … 84 85 } 85 86 86 bool LayerRendererChromium::compareLayerZ(const LayerChromium* a, const LayerChromium* b)87 { 88 return a-> m_drawDepth < b->m_drawDepth;87 bool LayerRendererChromium::compareLayerZ(const CCLayerImpl* a, const CCLayerImpl* b) 88 { 89 return a->drawDepth() < b->drawDepth(); 89 90 } 90 91 … … 221 222 int visibleRectHeight = visibleRect.height(); 222 223 223 if (!m_rootLayer-> m_renderSurface)224 m_rootLayer->c reateRenderSurface();225 m_rootLayer-> m_renderSurface->m_contentRect = IntRect(0, 0, visibleRectWidth, visibleRectHeight);224 if (!m_rootLayer->ccLayerImpl()->renderSurface()) 225 m_rootLayer->ccLayerImpl()->createRenderSurface(); 226 m_rootLayer->ccLayerImpl()->renderSurface()->m_contentRect = IntRect(0, 0, visibleRectWidth, visibleRectHeight); 226 227 227 228 if (visibleRectWidth != m_rootLayerTextureWidth || visibleRectHeight != m_rootLayerTextureHeight) { … … 249 250 m_scrollPosition = scrollPosition; 250 251 251 ASSERT(m_rootLayer-> m_renderSurface);252 m_defaultRenderSurface = m_rootLayer-> m_renderSurface.get();252 ASSERT(m_rootLayer->ccLayerImpl()->renderSurface()); 253 m_defaultRenderSurface = m_rootLayer->ccLayerImpl()->renderSurface(); 253 254 254 255 useRenderSurface(m_defaultRenderSurface); … … 280 281 // The scissorRect should not include the scroll offset. 281 282 rootScissorRect.move(-m_scrollPosition.x(), -m_scrollPosition.y()); 282 m_rootLayer-> m_scissorRect = rootScissorRect;283 284 Vector< LayerChromium*> renderSurfaceLayerList;285 renderSurfaceLayerList.append(m_rootLayer .get());283 m_rootLayer->ccLayerImpl()->setScissorRect(rootScissorRect); 284 285 Vector<CCLayerImpl*> renderSurfaceLayerList; 286 renderSurfaceLayerList.append(m_rootLayer->ccLayerImpl()); 286 287 287 288 TransformationMatrix identityMatrix; … … 299 300 // correct order. 300 301 for (int surfaceIndex = renderSurfaceLayerList.size() - 1; surfaceIndex >= 0 ; --surfaceIndex) { 301 LayerChromium* renderSurfaceLayer = renderSurfaceLayerList[surfaceIndex];302 ASSERT(renderSurfaceLayer-> m_renderSurface);302 CCLayerImpl* renderSurfaceLayer = renderSurfaceLayerList[surfaceIndex]; 303 ASSERT(renderSurfaceLayer->renderSurface()); 303 304 304 305 // Render surfaces whose drawable area has zero width or height 305 306 // will have no layers associated with them and should be skipped. 306 if (!renderSurfaceLayer-> m_renderSurface->m_layerList.size())307 if (!renderSurfaceLayer->renderSurface()->m_layerList.size()) 307 308 continue; 308 309 309 if (useRenderSurface(renderSurfaceLayer-> m_renderSurface.get())) {310 if (renderSurfaceLayer != m_rootLayer ) {310 if (useRenderSurface(renderSurfaceLayer->renderSurface())) { 311 if (renderSurfaceLayer != m_rootLayer->ccLayerImpl()) { 311 312 GLC(m_context.get(), m_context->disable(GraphicsContext3D::SCISSOR_TEST)); 312 313 GLC(m_context.get(), m_context->clearColor(0, 0, 0, 0)); … … 315 316 } 316 317 317 Vector< LayerChromium*>& layerList = renderSurfaceLayer->m_renderSurface->m_layerList;318 Vector<CCLayerImpl*>& layerList = renderSurfaceLayer->renderSurface()->m_layerList; 318 319 ASSERT(layerList.size()); 319 320 for (unsigned layerIndex = 0; layerIndex < layerList.size(); ++layerIndex) 320 drawLayer(layerList[layerIndex], renderSurfaceLayer-> m_renderSurface.get());321 drawLayer(layerList[layerIndex], renderSurfaceLayer->renderSurface()); 321 322 } 322 323 } … … 408 409 // Recursively walks the layer tree starting at the given node and computes all the 409 410 // necessary transformations, scissor rectangles, render surfaces, etc. 410 void LayerRendererChromium::updateLayersRecursive(LayerChromium* layer, const TransformationMatrix& parentMatrix, Vector< LayerChromium*>& renderSurfaceLayerList, Vector<LayerChromium*>& layerList)411 void LayerRendererChromium::updateLayersRecursive(LayerChromium* layer, const TransformationMatrix& parentMatrix, Vector<CCLayerImpl*>& renderSurfaceLayerList, Vector<CCLayerImpl*>& layerList) 411 412 { 412 413 layer->setLayerRenderer(this); 414 CCLayerImpl* drawLayer = layer->ccLayerImpl(); 413 415 414 416 // Compute the new matrix transformation that will be applied to this layer and … … 467 469 if (((useSurfaceForClipping || useSurfaceForOpacity) && layer->descendantsDrawContent()) 468 470 || useSurfaceForMasking || useSurfaceForReflection) { 469 RenderSurfaceChromium* renderSurface = layer->m_renderSurface.get();471 RenderSurfaceChromium* renderSurface = drawLayer->renderSurface(); 470 472 if (!renderSurface) 471 renderSurface = layer->createRenderSurface();473 renderSurface = drawLayer->createRenderSurface(); 472 474 473 475 // The origin of the new surface is the upper left corner of the layer. 474 layer->m_drawTransform = TransformationMatrix(); 475 layer->m_drawTransform.translate3d(0.5 * bounds.width(), 0.5 * bounds.height(), 0); 476 TransformationMatrix drawTransform;; 477 drawTransform.translate3d(0.5 * bounds.width(), 0.5 * bounds.height(), 0); 478 drawLayer->setDrawTransform(drawTransform); 476 479 477 480 transformedLayerRect = IntRect(0, 0, bounds.width(), bounds.height()); … … 480 483 renderSurface->m_drawOpacity = layer->opacity(); 481 484 if (layer->superlayer()->preserves3D()) 482 renderSurface->m_drawOpacity *= layer->superlayer()->drawOpacity();483 layer->m_drawOpacity = 1;485 renderSurface->m_drawOpacity *= drawLayer->superlayer()->drawOpacity(); 486 drawLayer->setDrawOpacity(1); 484 487 485 488 TransformationMatrix layerOriginTransform = combinedTransform; … … 489 492 TransformationMatrix parentToLayer = layerOriginTransform.inverse(); 490 493 491 layer->m_scissorRect = parentToLayer.mapRect(layer->superlayer()->m_scissorRect);494 drawLayer->setScissorRect(parentToLayer.mapRect(drawLayer->superlayer()->scissorRect())); 492 495 } else 493 layer->m_scissorRect = IntRect();496 drawLayer->setScissorRect(IntRect()); 494 497 495 498 // The render surface scissor rect is the scissor rect that needs to 496 499 // be applied before drawing the render surface onto its containing 497 500 // surface and is therefore expressed in the superlayer's coordinate system. 498 renderSurface->m_scissorRect = layer->superlayer()->m_scissorRect;501 renderSurface->m_scissorRect = drawLayer->superlayer()->scissorRect(); 499 502 500 503 renderSurface->m_layerList.clear(); 501 504 502 if (layer->mask Layer()) {503 renderSurface->m_maskLayer = layer->mask Layer();504 layer->mask Layer()->setLayerRenderer(this);505 layer->mask Layer()->m_targetRenderSurface = renderSurface;505 if (layer->maskDrawLayer()) { 506 renderSurface->m_maskLayer = layer->maskDrawLayer(); 507 layer->maskDrawLayer()->setLayerRenderer(this); 508 layer->maskDrawLayer()->setTargetRenderSurface(renderSurface); 506 509 } else 507 510 renderSurface->m_maskLayer = 0; 508 511 509 if (layer->replicaLayer() && layer->replicaLayer()->mask Layer()) {510 layer->replicaLayer()->mask Layer()->setLayerRenderer(this);511 layer->replicaLayer()->mask Layer()->m_targetRenderSurface = renderSurface;512 if (layer->replicaLayer() && layer->replicaLayer()->maskDrawLayer()) { 513 layer->replicaLayer()->maskDrawLayer()->setLayerRenderer(this); 514 layer->replicaLayer()->maskDrawLayer()->setTargetRenderSurface(renderSurface); 512 515 } 513 516 514 renderSurfaceLayerList.append( layer);517 renderSurfaceLayerList.append(drawLayer); 515 518 } else { 516 519 // DT = M[p] * LT 517 layer->m_drawTransform = combinedTransform;518 transformedLayerRect = enclosingIntRect( layer->m_drawTransform.mapRect(layerRect));519 520 layer->m_drawOpacity = layer->opacity();520 drawLayer->setDrawTransform(combinedTransform); 521 transformedLayerRect = enclosingIntRect(drawLayer->drawTransform().mapRect(layerRect)); 522 523 drawLayer->setDrawOpacity(layer->opacity()); 521 524 522 525 if (layer->superlayer()) { 523 526 if (layer->superlayer()->preserves3D()) 524 layer->m_drawOpacity *= layer->superlayer()->m_drawOpacity;527 drawLayer->setDrawOpacity(drawLayer->drawOpacity() * drawLayer->superlayer()->drawOpacity()); 525 528 526 529 // Layers inherit the scissor rect from their superlayer. 527 layer->m_scissorRect = layer->superlayer()->m_scissorRect;528 529 layer->m_targetRenderSurface = layer->superlayer()->m_targetRenderSurface;530 drawLayer->setScissorRect(drawLayer->superlayer()->scissorRect()); 531 532 drawLayer->setTargetRenderSurface(drawLayer->superlayer()->targetRenderSurface()); 530 533 } 531 534 532 535 if (layer != m_rootLayer) 533 layer->m_renderSurface = 0; 534 535 if (layer->masksToBounds()) 536 layer->m_scissorRect.intersect(transformedLayerRect); 537 } 538 539 if (layer->m_renderSurface) 540 layer->m_targetRenderSurface = layer->m_renderSurface.get(); 536 drawLayer->clearRenderSurface(); 537 538 if (layer->masksToBounds()) { 539 IntRect scissor = drawLayer->scissorRect(); 540 scissor.intersect(transformedLayerRect); 541 drawLayer->setScissorRect(scissor); 542 } 543 } 544 545 if (drawLayer->renderSurface()) 546 drawLayer->setTargetRenderSurface(drawLayer->renderSurface()); 541 547 else { 542 548 ASSERT(layer->superlayer()); 543 layer->m_targetRenderSurface = layer->superlayer()->m_targetRenderSurface;549 drawLayer->setTargetRenderSurface(drawLayer->superlayer()->targetRenderSurface()); 544 550 } 545 551 546 552 // m_drawableContentRect is always stored in the coordinate system of the 547 553 // RenderSurface the layer draws into. 548 if ( layer->drawsContent())549 layer->m_drawableContentRect = transformedLayerRect;554 if (drawLayer->drawsContent()) 555 drawLayer->setDrawableContentRect(transformedLayerRect); 550 556 else 551 layer->m_drawableContentRect = IntRect();552 553 TransformationMatrix sublayerMatrix = layer->m_drawTransform;557 drawLayer->setDrawableContentRect(IntRect()); 558 559 TransformationMatrix sublayerMatrix = drawLayer->drawTransform(); 554 560 555 561 // Flatten to 2D if the layer doesn't preserve 3D. … … 572 578 sublayerMatrix.translate3d(-bounds.width() * 0.5, -bounds.height() * 0.5, 0); 573 579 574 Vector< LayerChromium*>& descendants = (layer->m_renderSurface ? layer->m_renderSurface->m_layerList : layerList);575 descendants.append( layer);580 Vector<CCLayerImpl*>& descendants = (drawLayer->renderSurface() ? drawLayer->renderSurface()->m_layerList : layerList); 581 descendants.append(drawLayer); 576 582 unsigned thisLayerIndex = descendants.size() - 1; 577 583 578 584 const Vector<RefPtr<LayerChromium> >& sublayers = layer->getSublayers(); 579 585 for (size_t i = 0; i < sublayers.size(); ++i) { 580 LayerChromium* sublayer = sublayers[i].get(); 581 updateLayersRecursive(sublayer, sublayerMatrix, renderSurfaceLayerList, descendants); 582 583 if (sublayer->m_renderSurface) { 584 RenderSurfaceChromium* sublayerRenderSurface = sublayer->m_renderSurface.get(); 585 layer->m_drawableContentRect.unite(enclosingIntRect(sublayerRenderSurface->drawableContentRect())); 586 CCLayerImpl* sublayer = sublayers[i]->ccLayerImpl(); 587 updateLayersRecursive(sublayers[i].get(), sublayerMatrix, renderSurfaceLayerList, descendants); 588 589 if (sublayer->renderSurface()) { 590 RenderSurfaceChromium* sublayerRenderSurface = sublayer->renderSurface(); 591 IntRect drawableContentRect = drawLayer->drawableContentRect(); 592 drawableContentRect.unite(enclosingIntRect(sublayerRenderSurface->drawableContentRect())); 593 drawLayer->setDrawableContentRect(drawableContentRect); 586 594 descendants.append(sublayer); 587 } else 588 layer->m_drawableContentRect.unite(sublayer->m_drawableContentRect); 589 } 590 591 if (layer->masksToBounds() || useSurfaceForMasking) 592 layer->m_drawableContentRect.intersect(transformedLayerRect); 593 594 if (layer->m_renderSurface && layer != m_rootLayer) { 595 RenderSurfaceChromium* renderSurface = layer->m_renderSurface.get(); 596 renderSurface->m_contentRect = layer->m_drawableContentRect; 595 } else { 596 IntRect drawableContentRect = drawLayer->drawableContentRect(); 597 drawableContentRect.unite(sublayer->drawableContentRect()); 598 drawLayer->setDrawableContentRect(drawableContentRect); 599 } 600 } 601 602 if (layer->masksToBounds() || useSurfaceForMasking) { 603 IntRect drawableContentRect = drawLayer->drawableContentRect(); 604 drawableContentRect.intersect(transformedLayerRect); 605 drawLayer->setDrawableContentRect(drawableContentRect); 606 } 607 608 if (drawLayer->renderSurface() && layer != m_rootLayer) { 609 RenderSurfaceChromium* renderSurface = drawLayer->renderSurface(); 610 renderSurface->m_contentRect = drawLayer->drawableContentRect(); 597 611 FloatPoint surfaceCenter = renderSurface->contentRectCenter(); 598 612 … … 602 616 // clipped. 603 617 if (!layer->replicaLayer()) { 604 renderSurface->m_contentRect.intersect( layer->m_scissorRect);618 renderSurface->m_contentRect.intersect(drawLayer->scissorRect()); 605 619 FloatPoint clippedSurfaceCenter = renderSurface->contentRectCenter(); 606 620 centerOffsetDueToClipping = clippedSurfaceCenter - surfaceCenter; … … 617 631 // Since the layer starts a new render surface we need to adjust its 618 632 // scissor rect to be expressed in the new surface's coordinate system. 619 layer->m_scissorRect = layer->m_drawableContentRect;633 drawLayer->setScissorRect(drawLayer->drawableContentRect()); 620 634 621 635 // Adjust the origin of the transform to be the center of the render surface. … … 635 649 // Compute the depth value of the center of the layer which will be used when 636 650 // sorting the layers for the preserves-3d property. 637 TransformationMatrix& layerDrawMatrix = layer->m_renderSurface ? layer->m_renderSurface->m_drawTransform : layer->m_drawTransform;651 const TransformationMatrix& layerDrawMatrix = drawLayer->renderSurface() ? drawLayer->renderSurface()->m_drawTransform : drawLayer->drawTransform(); 638 652 if (layer->superlayer()) { 639 653 if (!layer->superlayer()->preserves3D()) 640 layer->m_drawDepth = layer->superlayer()->m_drawDepth;654 drawLayer->setDrawDepth(drawLayer->superlayer()->drawDepth()); 641 655 else 642 layer->m_drawDepth = layerDrawMatrix.m43();656 drawLayer->setDrawDepth(layerDrawMatrix.m43()); 643 657 } else 644 layer->m_drawDepth = 0;658 drawLayer->setDrawDepth(0); 645 659 646 660 // If preserves-3d then sort all the descendants by the Z coordinate of their … … 659 673 660 674 if (!m_compositeOffscreen && m_rootLayer) 661 m_rootLayer->m_renderSurface.clear(); 675 m_rootLayer->ccLayerImpl()->clearRenderSurface(); 676 } 677 678 LayerTexture* LayerRendererChromium::getOffscreenLayerTexture() 679 { 680 return m_compositeOffscreen ? m_rootLayer->ccLayerImpl()->renderSurface()->m_contentsTexture.get() : 0; 662 681 } 663 682 … … 710 729 } 711 730 712 void LayerRendererChromium::drawLayer( LayerChromium* layer, RenderSurfaceChromium* targetSurface)713 { 714 if (layer-> m_renderSurface && layer->m_renderSurface!= targetSurface) {715 layer-> m_renderSurface->draw();731 void LayerRendererChromium::drawLayer(CCLayerImpl* layer, RenderSurfaceChromium* targetSurface) 732 { 733 if (layer->renderSurface() && layer->renderSurface() != targetSurface) { 734 layer->renderSurface()->draw(); 716 735 return; 717 736 } 718 737 719 if (layer-> m_bounds.isEmpty())738 if (layer->bounds().isEmpty()) 720 739 return; 721 740 722 setScissorToRect(layer-> m_scissorRect);741 setScissorToRect(layer->scissorRect()); 723 742 724 743 // Check if the layer falls within the visible bounds of the page. 725 744 IntRect layerRect = layer->getDrawRect(); 726 bool isLayerVisible = layer-> m_scissorRect.intersects(layerRect);745 bool isLayerVisible = layer->scissorRect().intersects(layerRect); 727 746 if (!isLayerVisible) 728 747 return; … … 730 749 // FIXME: Need to take into account the commulative render surface transforms all the way from 731 750 // the default render surface in order to determine visibility. 732 TransformationMatrix combinedDrawMatrix = (layer-> m_renderSurface ? layer->m_renderSurface->drawTransform().multiply(layer->m_drawTransform) : layer->m_drawTransform);751 TransformationMatrix combinedDrawMatrix = (layer->renderSurface() ? layer->renderSurface()->drawTransform().multiply(layer->drawTransform()) : layer->drawTransform()); 733 752 if (!layer->doubleSided() && combinedDrawMatrix.m33() < 0) 734 753 return; 735 754 736 755 if (layer->drawsContent()) { 737 // Update the contents of the layer if necessary.738 756 layer->updateContentsIfDirty(); 739 757 m_context->makeContextCurrent(); -
trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h
r79578 r79659 58 58 namespace WebCore { 59 59 60 class CCLayerImpl; 60 61 class GeometryBinding; 61 62 class GraphicsContext3D; … … 91 92 void setCompositeOffscreen(bool); 92 93 bool isCompositingOffscreen() const { return m_compositeOffscreen; } 93 LayerTexture* getOffscreenLayerTexture() { return m_compositeOffscreen ? m_rootLayer->m_renderSurface->m_contentsTexture.get() : 0; }94 LayerTexture* getOffscreenLayerTexture(); 94 95 void copyOffscreenTextureToDisplay(); 95 96 … … 132 133 private: 133 134 explicit LayerRendererChromium(PassRefPtr<GraphicsContext3D> graphicsContext3D); 134 void updateLayersRecursive(LayerChromium* layer, const TransformationMatrix& parentMatrix, Vector<LayerChromium*>& renderSurfaceLayerList, Vector<LayerChromium*>& layerList);135 136 void drawLayer( LayerChromium*, RenderSurfaceChromium*);135 void updateLayersRecursive(LayerChromium*, const TransformationMatrix& parentMatrix, Vector<CCLayerImpl*>& renderSurfaceLayerList, Vector<CCLayerImpl*>& layerList); 136 137 void drawLayer(CCLayerImpl*, RenderSurfaceChromium*); 137 138 138 139 void updateAndDrawRootLayer(TilePaintInterface& tilePaint, TilePaintInterface& scrollbarPaint, const IntRect& visibleRect, const IntRect& contentRect); … … 146 147 bool makeContextCurrent(); 147 148 148 static bool compareLayerZ(const LayerChromium*, const LayerChromium*);149 static bool compareLayerZ(const CCLayerImpl*, const CCLayerImpl*); 149 150 150 151 bool initializeSharedObjects(); -
trunk/Source/WebCore/platform/graphics/chromium/PluginLayerChromium.cpp
r79043 r79659 30 30 #include "PluginLayerChromium.h" 31 31 32 #include "cc/CCLayerImpl.h" 32 33 #include "GraphicsContext3D.h" 33 34 #include "LayerRendererChromium.h" … … 73 74 layerRenderer()->useShader(program->program()); 74 75 GLC(context, context->uniform1i(program->fragmentShader().samplerLocation(), 0)); 75 drawTexturedQuad(context, layerRenderer()->projectionMatrix(), drawTransform(),76 bounds().width(), bounds().height(), drawOpacity(),76 drawTexturedQuad(context, layerRenderer()->projectionMatrix(), ccLayerImpl()->drawTransform(), 77 bounds().width(), bounds().height(), ccLayerImpl()->drawOpacity(), 77 78 program->vertexShader().matrixLocation(), 78 79 program->fragmentShader().alphaLocation()); -
trunk/Source/WebCore/platform/graphics/chromium/RenderSurfaceChromium.cpp
r79043 r79659 30 30 #include "RenderSurfaceChromium.h" 31 31 32 #include "cc/CCLayerImpl.h" 32 33 #include "GraphicsContext3D.h" 33 34 #include "LayerRendererChromium.h" … … 36 37 namespace WebCore { 37 38 38 RenderSurfaceChromium::RenderSurfaceChromium( LayerChromium* owningLayer)39 RenderSurfaceChromium::RenderSurfaceChromium(CCLayerImpl* owningLayer) 39 40 : m_owningLayer(owningLayer) 40 41 , m_maskLayer(0) … … 95 96 } 96 97 97 void RenderSurfaceChromium::drawSurface( LayerChromium* maskLayer, const TransformationMatrix& drawTransform)98 void RenderSurfaceChromium::drawSurface(CCLayerImpl* maskLayer, const TransformationMatrix& drawTransform) 98 99 { 99 100 GraphicsContext3D* context3D = layerRenderer()->context(); … … 151 152 // to draw the layer and its reflection in. For now we only apply a separate reflection 152 153 // mask if the contents don't have a mask of their own. 153 LayerChromium* replicaMaskLayer = m_maskLayer;154 CCLayerImpl* replicaMaskLayer = m_maskLayer; 154 155 if (!m_maskLayer && m_owningLayer->replicaLayer()) 155 156 replicaMaskLayer = m_owningLayer->replicaLayer()->maskLayer(); -
trunk/Source/WebCore/platform/graphics/chromium/RenderSurfaceChromium.h
r79043 r79659 40 40 namespace WebCore { 41 41 42 class LayerChromium;42 class CCLayerImpl; 43 43 class LayerRendererChromium; 44 44 class LayerTexture; … … 48 48 friend class LayerRendererChromium; 49 49 public: 50 explicit RenderSurfaceChromium( LayerChromium*);50 explicit RenderSurfaceChromium(CCLayerImpl*); 51 51 ~RenderSurfaceChromium(); 52 52 … … 68 68 private: 69 69 LayerRendererChromium* layerRenderer(); 70 void drawSurface( LayerChromium* maskLayer, const TransformationMatrix& drawTransform);70 void drawSurface(CCLayerImpl* maskLayer, const TransformationMatrix& drawTransform); 71 71 72 LayerChromium* m_owningLayer;73 LayerChromium* m_maskLayer;72 CCLayerImpl* m_owningLayer; 73 CCLayerImpl* m_maskLayer; 74 74 75 75 IntRect m_contentRect; … … 81 81 TransformationMatrix m_originTransform; 82 82 IntRect m_scissorRect; 83 Vector< LayerChromium*> m_layerList;83 Vector<CCLayerImpl*> m_layerList; 84 84 }; 85 85 -
trunk/Source/WebCore/platform/graphics/chromium/VideoLayerChromium.cpp
r79043 r79659 34 34 #include "VideoLayerChromium.h" 35 35 36 #include "cc/CCLayerImpl.h" 36 37 #include "Extensions3DChromium.h" 37 38 #include "GraphicsContext3D.h" … … 295 296 GLC(context, context->uniformMatrix3fv(program->fragmentShader().ccMatrixLocation(), 0, const_cast<float*>(yuv2RGB), 1)); 296 297 297 drawTexturedQuad(context, layerRenderer()->projectionMatrix(), drawTransform(),298 bounds().width(), bounds().height(), drawOpacity(),298 drawTexturedQuad(context, layerRenderer()->projectionMatrix(), ccLayerImpl()->drawTransform(), 299 bounds().width(), bounds().height(), ccLayerImpl()->drawOpacity(), 299 300 program->vertexShader().matrixLocation(), 300 301 program->fragmentShader().alphaLocation()); … … 318 319 GLC(context, context->uniform1i(program->fragmentShader().samplerLocation(), 0)); 319 320 320 drawTexturedQuad(context, layerRenderer()->projectionMatrix(), drawTransform(),321 bounds().width(), bounds().height(), drawOpacity(),321 drawTexturedQuad(context, layerRenderer()->projectionMatrix(), ccLayerImpl()->drawTransform(), 322 bounds().width(), bounds().height(), ccLayerImpl()->drawOpacity(), 322 323 program->vertexShader().matrixLocation(), 323 324 program->fragmentShader().alphaLocation());
Note: See TracChangeset
for help on using the changeset viewer.