Changeset 92245 in webkit
- Timestamp:
- Aug 2, 2011 4:20:44 PM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 25 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r92243 r92245 1 2011-08-02 James Robinson <jamesr@chromium.org> 2 3 [chromium] Decouple layer visibility calculations from render surfaces / computed draw transforms 4 https://bugs.webkit.org/show_bug.cgi?id=58840 5 6 Reviewed by Kenneth Russell. 7 8 This decouples the layer visibility related calculations from the LayerChromium and CCLayerImpl trees. This is 9 done by making LayerRendererChromium's "calculate the world" function (renamed 10 calculateDrawTransformsAndVisibility()) a templated, free function that can operate on either LayerChromium + 11 RenderSurfaceChromium pairs or on CCLayerImpl + CCRenderSurface pairs and invoking it twice, once before 12 painting and once before drawing. Before painting, these calculations are used to determine which layers are 13 potentially visible and should be painted, which depends on the calculated opacity, render surface bounds, and 14 draw transforms. Before drawing, these calculations are used to figure out everything needed to draw. 15 16 RenderSurfaceChromium is now used just for visibility calculations when painting. CCRenderSurfaceChromium is 17 responsible for actually drawing the render surfaces. 18 19 This does mean that in the current implementation the second calculations are redundant, but in the future this 20 won't be the case since the pre-draw time calculations might be influenced by animations or gestures. I've 21 added some traces to try to monitor if this math is a significant amount of the per-frame computation. Note 22 that layer sorting only happens on the CCLayerImpl tree and the layer sort algorithm is the most expensive part 23 of the calculations currently. 24 25 This removes all of the weak back/forward pointers between LayerChromium and CCLayerImpls, the trees are now 26 truly decoupled. 27 28 Covered by compositing/ tests. 29 30 * WebCore.gypi: 31 * platform/graphics/chromium/CanvasLayerChromium.cpp: 32 (WebCore::CanvasLayerChromium::createCCLayerImpl): 33 * platform/graphics/chromium/LayerChromium.cpp: 34 (WebCore::LayerChromium::LayerChromium): 35 (WebCore::LayerChromium::~LayerChromium): 36 (WebCore::LayerChromium::createCCLayerImpl): 37 (WebCore::LayerChromium::createRenderSurface): 38 (WebCore::LayerChromium::descendantsDrawsContent): 39 * platform/graphics/chromium/LayerChromium.h: 40 (WebCore::LayerChromium::setUsesLayerScissor): 41 (WebCore::LayerChromium::usesLayerScissor): 42 (WebCore::LayerChromium::clearRenderSurface): 43 (WebCore::LayerChromium::renderSurface): 44 (WebCore::LayerChromium::drawOpacity): 45 (WebCore::LayerChromium::setDrawOpacity): 46 (WebCore::LayerChromium::scissorRect): 47 (WebCore::LayerChromium::setScissorRect): 48 (WebCore::LayerChromium::targetRenderSurface): 49 (WebCore::LayerChromium::setTargetRenderSurface): 50 (WebCore::LayerChromium::drawTransform): 51 (WebCore::LayerChromium::setDrawTransform): 52 (WebCore::LayerChromium::drawableContentRect): 53 (WebCore::LayerChromium::setDrawableContentRect): 54 * platform/graphics/chromium/LayerRendererChromium.cpp: 55 (WebCore::LayerRendererChromium::updateLayers): 56 (WebCore::LayerRendererChromium::drawLayers): 57 (WebCore::LayerRendererChromium::paintLayerContents): 58 (WebCore::LayerRendererChromium::drawLayersInternal): 59 (WebCore::LayerRendererChromium::updateCompositorResources): 60 (WebCore::LayerRendererChromium::setCompositeOffscreen): 61 (WebCore::LayerRendererChromium::getOffscreenLayerTexture): 62 (WebCore::LayerRendererChromium::useRenderSurface): 63 (WebCore::LayerRendererChromium::drawLayer): 64 (WebCore::LayerRendererChromium::initializeSharedObjects): 65 (WebCore::LayerRendererChromium::renderSurfaceProgram): 66 (WebCore::LayerRendererChromium::renderSurfaceMaskProgram): 67 (WebCore::LayerRendererChromium::dumpRenderSurfaces): 68 * platform/graphics/chromium/LayerRendererChromium.h: 69 * platform/graphics/chromium/PluginLayerChromium.cpp: 70 (WebCore::PluginLayerChromium::createCCLayerImpl): 71 * platform/graphics/chromium/RenderSurfaceChromium.cpp: 72 (WebCore::RenderSurfaceChromium::RenderSurfaceChromium): 73 (WebCore::RenderSurfaceChromium::~RenderSurfaceChromium): 74 * platform/graphics/chromium/RenderSurfaceChromium.h: 75 (WebCore::RenderSurfaceChromium::clearLayerList): 76 (WebCore::RenderSurfaceChromium::layerList): 77 (WebCore::RenderSurfaceChromium::setMaskLayer): 78 * platform/graphics/chromium/TiledLayerChromium.cpp: 79 (WebCore::TiledLayerChromium::createCCLayerImpl): 80 (WebCore::TiledLayerChromium::tilingTransform): 81 * platform/graphics/chromium/TreeSynchronizer.cpp: 82 (WebCore::TreeSynchronizer::synchronizeTreeRecursive): 83 * platform/graphics/chromium/VideoLayerChromium.cpp: 84 (WebCore::VideoLayerChromium::createCCLayerImpl): 85 * platform/graphics/chromium/cc/CCCanvasLayerImpl.cpp: 86 (WebCore::CCCanvasLayerImpl::CCCanvasLayerImpl): 87 * platform/graphics/chromium/cc/CCCanvasLayerImpl.h: 88 (WebCore::CCCanvasLayerImpl::create): 89 * platform/graphics/chromium/cc/CCLayerImpl.cpp: 90 (WebCore::CCLayerImpl::CCLayerImpl): 91 (WebCore::CCLayerImpl::~CCLayerImpl): 92 (WebCore::CCLayerImpl::createRenderSurface): 93 (WebCore::CCLayerImpl::bindContentsTexture): 94 * platform/graphics/chromium/cc/CCLayerImpl.h: 95 (WebCore::CCLayerImpl::create): 96 (WebCore::CCLayerImpl::renderSurface): 97 (WebCore::CCLayerImpl::targetRenderSurface): 98 (WebCore::CCLayerImpl::setTargetRenderSurface): 99 * platform/graphics/chromium/cc/CCLayerSorter.cpp: 100 (WebCore::CCLayerSorter::createGraphNodes): 101 * platform/graphics/chromium/cc/CCPluginLayerImpl.cpp: 102 (WebCore::CCPluginLayerImpl::CCPluginLayerImpl): 103 * platform/graphics/chromium/cc/CCPluginLayerImpl.h: 104 (WebCore::CCPluginLayerImpl::create): 105 * platform/graphics/chromium/cc/CCRenderSurface.cpp: Copied from Source/WebCore/platform/graphics/chromium/RenderSurfaceChromium.cpp. 106 (WebCore::CCRenderSurface::CCRenderSurface): 107 (WebCore::CCRenderSurface::~CCRenderSurface): 108 (WebCore::CCRenderSurface::cleanupResources): 109 (WebCore::CCRenderSurface::layerRenderer): 110 (WebCore::CCRenderSurface::drawableContentRect): 111 (WebCore::CCRenderSurface::prepareContentsTexture): 112 (WebCore::CCRenderSurface::releaseContentsTexture): 113 (WebCore::CCRenderSurface::drawSurface): 114 (WebCore::CCRenderSurface::draw): 115 (WebCore::CCRenderSurface::name): 116 (WebCore::writeIndent): 117 (WebCore::CCRenderSurface::dumpSurface): 118 (WebCore::CCRenderSurface::owningLayerId): 119 * platform/graphics/chromium/cc/CCRenderSurface.h: Copied from Source/WebCore/platform/graphics/chromium/RenderSurfaceChromium.h. 120 (WebCore::CCRenderSurface::contentRectCenter): 121 (WebCore::CCRenderSurface::drawOpacity): 122 (WebCore::CCRenderSurface::setDrawOpacity): 123 (WebCore::CCRenderSurface::setDrawTransform): 124 (WebCore::CCRenderSurface::drawTransform): 125 (WebCore::CCRenderSurface::setReplicaDrawTransform): 126 (WebCore::CCRenderSurface::replicaDrawTransform): 127 (WebCore::CCRenderSurface::setOriginTransform): 128 (WebCore::CCRenderSurface::originTransform): 129 (WebCore::CCRenderSurface::setScissorRect): 130 (WebCore::CCRenderSurface::scissorRect): 131 (WebCore::CCRenderSurface::setContentRect): 132 (WebCore::CCRenderSurface::contentRect): 133 (WebCore::CCRenderSurface::setSkipsDraw): 134 (WebCore::CCRenderSurface::skipsDraw): 135 (WebCore::CCRenderSurface::clearLayerList): 136 (WebCore::CCRenderSurface::layerList): 137 (WebCore::CCRenderSurface::setMaskLayer): 138 (WebCore::CCRenderSurface::contentsTexture): 139 * platform/graphics/chromium/cc/CCTiledLayerImpl.cpp: 140 (WebCore::CCTiledLayerImpl::CCTiledLayerImpl): 141 * platform/graphics/chromium/cc/CCTiledLayerImpl.h: 142 (WebCore::CCTiledLayerImpl::create): 143 * platform/graphics/chromium/cc/CCVideoLayerImpl.cpp: 144 (WebCore::CCVideoLayerImpl::CCVideoLayerImpl): 145 * platform/graphics/chromium/cc/CCVideoLayerImpl.h: 146 (WebCore::CCVideoLayerImpl::create): 147 1 148 2011-08-02 Luke Macpherson <macpherson@chromium.org> 2 149 -
trunk/Source/WebCore/WebCore.gypi
r92161 r92245 3560 3560 'platform/graphics/chromium/cc/CCPluginLayerImpl.cpp', 3561 3561 'platform/graphics/chromium/cc/CCPluginLayerImpl.h', 3562 'platform/graphics/chromium/cc/CCRenderSurface.cpp', 3563 'platform/graphics/chromium/cc/CCRenderSurface.h', 3562 3564 'platform/graphics/chromium/cc/CCThread.cpp', 3563 3565 'platform/graphics/chromium/cc/CCThread.h', -
trunk/Source/WebCore/platform/graphics/chromium/CanvasLayerChromium.cpp
r86905 r92245 56 56 PassRefPtr<CCLayerImpl> CanvasLayerChromium::createCCLayerImpl() 57 57 { 58 return CCCanvasLayerImpl::create( this,m_layerId);58 return CCCanvasLayerImpl::create(m_layerId); 59 59 } 60 60 -
trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp
r90963 r92245 62 62 , m_layerId(s_nextLayerId++) 63 63 , m_parent(0) 64 , m_ccLayerImpl(0)65 64 , m_anchorPoint(0.5, 0.5) 66 65 , m_backgroundColor(0, 0, 0, 0) 66 , m_debugBorderWidth(0) 67 67 , m_opacity(1.0) 68 68 , m_zPosition(0.0) … … 75 75 , m_needsDisplayOnBoundsChange(false) 76 76 , m_doubleSided(true) 77 , m_usesLayerScissor(false) 77 78 , m_replicaLayer(0) 79 , m_drawOpacity(0) 80 , m_targetRenderSurface(0) 78 81 { 79 82 ASSERT(!LayerRendererChromium::s_inPaintLayerContents); … … 86 89 // way for us to be destroyed while we still have a parent. 87 90 ASSERT(!parent()); 88 89 if (m_ccLayerImpl)90 m_ccLayerImpl->clearOwner();91 91 92 92 // Remove the parent reference from all children. … … 382 382 PassRefPtr<CCLayerImpl> LayerChromium::createCCLayerImpl() 383 383 { 384 return CCLayerImpl::create(this, m_layerId); 385 } 386 387 CCLayerImpl* LayerChromium::ccLayerImpl() const 388 { 389 return m_ccLayerImpl; 384 return CCLayerImpl::create(m_layerId); 390 385 } 391 386 … … 407 402 } 408 403 404 void LayerChromium::createRenderSurface() 405 { 406 ASSERT(!m_renderSurface); 407 m_renderSurface = adoptPtr(new RenderSurfaceChromium(this)); 408 } 409 410 bool LayerChromium::descendantDrawsContent() 411 { 412 for (size_t i = 0; i < m_children.size(); ++i) { 413 if (m_children[i]->drawsContent() || m_children[i]->descendantDrawsContent()) 414 return true; 415 } 416 return false; 417 } 418 409 419 } 410 420 #endif // USE(ACCELERATED_COMPOSITING) -
trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.h
r90963 r92245 105 105 106 106 void setMaskLayer(LayerChromium* maskLayer) { m_maskLayer = maskLayer; } 107 CCLayerImpl* maskDrawLayer() const { return m_maskLayer ? m_maskLayer->ccLayerImpl() : 0; }108 107 LayerChromium* maskLayer() const { return m_maskLayer.get(); } 109 108 … … 145 144 146 145 bool preserves3D() { return m_owner && m_owner->preserves3D(); } 146 147 void setUsesLayerScissor(bool usesLayerScissor) { m_usesLayerScissor = usesLayerScissor; } 148 bool usesLayerScissor() const { return m_usesLayerScissor; } 147 149 148 150 // Derived types must override this method if they need to react to a change … … 171 173 void setBorderWidth(float); 172 174 173 // Everything from here down in the public section will move to CCLayerImpl.174 CCLayerImpl* ccLayerImpl() const;175 176 175 static void drawTexturedQuad(GraphicsContext3D*, const TransformationMatrix& projectionMatrix, const TransformationMatrix& layerMatrix, 177 176 float width, float height, float opacity, … … 187 186 188 187 int id() const { return m_layerId; } 188 189 void clearRenderSurface() { m_renderSurface.clear(); } 190 RenderSurfaceChromium* renderSurface() const { return m_renderSurface.get(); } 191 void createRenderSurface(); 192 193 float drawOpacity() const { return m_drawOpacity; } 194 void setDrawOpacity(float opacity) { m_drawOpacity = opacity; } 195 const IntRect& scissorRect() const { return m_scissorRect; } 196 void setScissorRect(const IntRect& rect) { m_scissorRect = rect; } 197 RenderSurfaceChromium* targetRenderSurface() const { return m_targetRenderSurface; } 198 void setTargetRenderSurface(RenderSurfaceChromium* surface) { m_targetRenderSurface = surface; } 199 const TransformationMatrix& drawTransform() const { return m_drawTransform; } 200 void setDrawTransform(const TransformationMatrix& matrix) { m_drawTransform = matrix; } 201 const IntRect& drawableContentRect() const { return m_drawableContentRect; } 202 void setDrawableContentRect(const IntRect& rect) { m_drawableContentRect = rect; } 203 204 // Returns true if any of the layer's descendants has content to draw. 205 bool descendantDrawsContent(); 189 206 190 207 protected: … … 211 228 RefPtr<LayerChromium> m_maskLayer; 212 229 213 // All layer shaders share the same attribute locations for the vertex positions214 // and texture coordinates. This allows switching shaders without rebinding attribute215 // arrays.216 static const unsigned s_positionAttribLocation;217 static const unsigned s_texCoordAttribLocation;218 219 230 friend class TreeSynchronizer; 220 231 friend class CCLayerImpl; 221 232 // Constructs a CCLayerImpl of the correct runtime type for this LayerChromium type. 222 233 virtual PassRefPtr<CCLayerImpl> createCCLayerImpl(); 223 // FIXME: Remove when https://bugs.webkit.org/show_bug.cgi?id=58830 is fixed.224 void setCCLayerImpl(CCLayerImpl* impl) { m_ccLayerImpl = impl; }225 234 int m_layerId; 226 235 … … 245 254 246 255 RefPtr<LayerRendererChromium> m_layerRenderer; 247 248 // Temporary forward weak pointer to the CCLayerImpl associated with this layer.249 // FIXME: Remove when https://bugs.webkit.org/show_bug.cgi?id=58830 is fixed.250 CCLayerImpl* m_ccLayerImpl;251 256 252 257 // Layer properties. … … 268 273 bool m_needsDisplayOnBoundsChange; 269 274 bool m_doubleSided; 275 bool m_usesLayerScissor; 270 276 271 277 TransformationMatrix m_transform; … … 277 283 RefPtr<LayerChromium> m_replicaLayer; 278 284 285 // Transient properties. 286 OwnPtr<RenderSurfaceChromium> m_renderSurface; 287 float m_drawOpacity; 288 IntRect m_scissorRect; 289 RenderSurfaceChromium* m_targetRenderSurface; 290 TransformationMatrix m_drawTransform; 291 IntRect m_drawableContentRect; 292 279 293 String m_name; 280 294 }; -
trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
r92206 r92245 45 45 #include "LayerTextureUpdaterCanvas.h" 46 46 #include "NotImplemented.h" 47 #include "RenderSurfaceChromium.h" 47 48 #include "TextStream.h" 48 49 #include "TextureManager.h" … … 64 65 #include <wtf/MainThread.h> 65 66 67 using namespace std; 68 66 69 namespace WebCore { 67 70 … … 79 82 #endif 80 83 81 static IntRect calculateVisibleRect(const IntRect& targetSurfaceRect, const IntRect& layerBoundRect, const TransformationMatrix& transform) 84 namespace { 85 86 IntRect calculateVisibleRect(const IntRect& targetSurfaceRect, const IntRect& layerBoundRect, const TransformationMatrix& transform) 82 87 { 83 88 // Is this layer fully contained within the target surface? … … 103 108 104 109 // Returns true if the matrix has no rotation, skew or perspective components to it. 105 staticbool isScaleOrTranslation(const TransformationMatrix& m)110 bool isScaleOrTranslation(const TransformationMatrix& m) 106 111 { 107 112 return !m.m12() && !m.m13() && !m.m14() … … 112 117 } 113 118 119 void sortLayers(Vector<RefPtr<LayerChromium> >::iterator, Vector<RefPtr<LayerChromium> >::iterator, void*) 120 { 121 // Currently we don't use z-order to decide what to paint, so there's no need to actually sort LayerChromiums. 122 } 123 124 void sortLayers(Vector<RefPtr<CCLayerImpl> >::iterator first, Vector<RefPtr<CCLayerImpl> >::iterator end, CCLayerSorter* layerSorter) 125 { 126 TRACE_EVENT("LayerRendererChromium::sortLayers", 0, 0); 127 layerSorter->sort(first, end); 128 } 129 114 130 // Recursively walks the layer tree starting at the given node and computes all the 115 131 // necessary transformations, scissor rectangles, render surfaces, etc. 116 void LayerRendererChromium::updatePropertiesAndRenderSurfaces(CCLayerImpl* layer, const TransformationMatrix& parentMatrix, LayerList& renderSurfaceLayerList, LayerList& layerList) 117 { 132 template<typename LayerType, typename RenderSurfaceType, typename LayerSorter> 133 void calculateDrawTransformsAndVisibility(LayerType* layer, LayerType* rootLayer, const TransformationMatrix& parentMatrix, Vector<RefPtr<LayerType> >& renderSurfaceLayerList, Vector<RefPtr<LayerType> >& layerList, LayerSorter* layerSorter, int maxTextureSize) 134 { 135 typedef Vector<RefPtr<LayerType> > LayerList; 118 136 // Compute the new matrix transformation that will be applied to this layer and 119 137 // all its children. It's important to remember that the layer's position … … 173 191 bool useSurfaceForMasking = layer->maskLayer(); 174 192 bool useSurfaceForReflection = layer->replicaLayer(); 175 bool useSurfaceForFlatDescendants = layer->parent() && layer->parent()->preserves3D() && !layer->preserves3D() && layer->descendant sDrawsContent();176 if (useSurfaceForMasking || useSurfaceForReflection || useSurfaceForFlatDescendants || ((useSurfaceForClipping || useSurfaceForOpacity) && layer->descendant sDrawsContent())) {177 RenderSurfaceChromium* renderSurface = layer->renderSurface();178 if (!renderSurface)179 renderSurface = layer->createRenderSurface();193 bool useSurfaceForFlatDescendants = layer->parent() && layer->parent()->preserves3D() && !layer->preserves3D() && layer->descendantDrawsContent(); 194 if (useSurfaceForMasking || useSurfaceForReflection || useSurfaceForFlatDescendants || ((useSurfaceForClipping || useSurfaceForOpacity) && layer->descendantDrawsContent())) { 195 if (!layer->renderSurface()) 196 layer->createRenderSurface(); 197 RenderSurfaceType* renderSurface = layer->renderSurface(); 180 198 181 199 // The origin of the new surface is the upper left corner of the layer. … … 233 251 } 234 252 235 if (layer != m_rootCCLayerImpl.get())253 if (layer != rootLayer) 236 254 layer->clearRenderSurface(); 237 255 … … 289 307 290 308 for (size_t i = 0; i < layer->children().size(); ++i) { 291 CCLayerImpl* child = layer->children()[i].get();292 updatePropertiesAndRenderSurfaces(child, sublayerMatrix, renderSurfaceLayerList, descendants);309 LayerType* child = layer->children()[i].get(); 310 calculateDrawTransformsAndVisibility<LayerType, RenderSurfaceType, LayerSorter>(child, rootLayer, sublayerMatrix, renderSurfaceLayerList, descendants, layerSorter, maxTextureSize); 293 311 294 312 if (child->renderSurface()) { 295 RenderSurface Chromium* childRenderSurface = child->renderSurface();313 RenderSurfaceType* childRenderSurface = child->renderSurface(); 296 314 IntRect drawableContentRect = layer->drawableContentRect(); 297 315 drawableContentRect.unite(enclosingIntRect(childRenderSurface->drawableContentRect())); … … 311 329 } 312 330 313 if (layer->renderSurface() && layer != m_rootCCLayerImpl.get()) {314 RenderSurface Chromium* renderSurface = layer->renderSurface();315 IntRect renderSurfaceContentRect = layer->drawableContentRect();316 FloatPoint surfaceCenter = FloatRect( renderSurfaceContentRect).center();331 if (layer->renderSurface() && layer != rootLayer) { 332 RenderSurfaceType* renderSurface = layer->renderSurface(); 333 IntRect clippedContentRect = layer->drawableContentRect(); 334 FloatPoint surfaceCenter = FloatRect(clippedContentRect).center(); 317 335 318 336 // Restrict the RenderSurface size to the portion that's visible. … … 322 340 // clipped. 323 341 if (!layer->replicaLayer()) { 324 if (!renderSurface->scissorRect().isEmpty() && ! renderSurfaceContentRect.isEmpty()) {325 IntRect surfaceScissorRect = calculateVisibleRect(renderSurface->scissorRect(), renderSurfaceContentRect, renderSurface->originTransform());326 renderSurfaceContentRect.intersect(surfaceScissorRect);342 if (!renderSurface->scissorRect().isEmpty() && !clippedContentRect.isEmpty()) { 343 IntRect surfaceScissorRect = calculateVisibleRect(renderSurface->scissorRect(), clippedContentRect, renderSurface->originTransform()); 344 clippedContentRect.intersect(surfaceScissorRect); 327 345 } 328 FloatPoint clippedSurfaceCenter = FloatRect( renderSurfaceContentRect).center();346 FloatPoint clippedSurfaceCenter = FloatRect(clippedContentRect).center(); 329 347 centerOffsetDueToClipping = clippedSurfaceCenter - surfaceCenter; 330 348 } … … 332 350 // The RenderSurface backing texture cannot exceed the maximum supported 333 351 // texture size. 334 renderSurfaceContentRect.setWidth(std::min(renderSurfaceContentRect.width(), m_maxTextureSize));335 renderSurfaceContentRect.setHeight(std::min(renderSurfaceContentRect.height(), m_maxTextureSize));336 337 if ( renderSurfaceContentRect.isEmpty())352 clippedContentRect.setWidth(min(clippedContentRect.width(), maxTextureSize)); 353 clippedContentRect.setHeight(min(clippedContentRect.height(), maxTextureSize)); 354 355 if (clippedContentRect.isEmpty()) 338 356 renderSurface->clearLayerList(); 339 renderSurface->setContentRect(renderSurfaceContentRect); 357 358 renderSurface->setContentRect(clippedContentRect); 340 359 341 360 // Since the layer starts a new render surface we need to adjust its … … 363 382 // skip the sorting as the parent will sort all the descendants anyway. 364 383 if (layer->preserves3D() && (!layer->parent() || !layer->parent()->preserves3D())) 365 m_layerSorter.sort(&descendants.at(thisLayerIndex), descendants.end()); 384 sortLayers(&descendants.at(thisLayerIndex), descendants.end(), layerSorter); 385 } 386 366 387 } 367 388 … … 550 571 return; 551 572 552 { 553 TRACE_EVENT("LayerRendererChromium::synchronizeTrees", this, 0); 554 m_rootCCLayerImpl = TreeSynchronizer::synchronizeTrees(m_rootLayer.get(), m_rootCCLayerImpl.get()); 555 } 556 557 m_computedRenderSurfaceLayerList = adoptPtr(new LayerList()); 558 updateLayers(*m_computedRenderSurfaceLayerList); 573 updateLayers(m_rootLayer.get()); 559 574 } 560 575 … … 562 577 { 563 578 ASSERT(m_hardwareCompositing); 564 ASSERT(m_computedRenderSurfaceLayerList);565 579 // Before drawLayers: 566 580 if (hardwareCompositing()) { … … 576 590 } 577 591 592 { 593 TRACE_EVENT("LayerRendererChromium::synchronizeTrees", this, 0); 594 m_rootCCLayerImpl = TreeSynchronizer::synchronizeTrees(m_rootLayer.get(), m_rootCCLayerImpl.get()); 595 } 596 597 578 598 m_renderSurfaceTextureManager->setMemoryLimitBytes(textureMemoryHighLimitBytes - m_contentsTextureManager->currentMemoryUseBytes()); 579 drawLayers (*m_computedRenderSurfaceLayerList);599 drawLayersInternal(); 580 600 581 601 m_contentsTextureManager->unprotectAllTextures(); … … 591 611 } 592 612 593 void LayerRendererChromium::updateLayers(Layer List& renderSurfaceLayerList)613 void LayerRendererChromium::updateLayers(LayerChromium* rootLayer) 594 614 { 595 615 TRACE_EVENT("LayerRendererChromium::updateLayers", this, 0); 596 CCLayerImpl* rootDrawLayer = m_rootLayer->ccLayerImpl(); 597 598 if (!rootDrawLayer->renderSurface()) 599 rootDrawLayer->createRenderSurface(); 600 ASSERT(rootDrawLayer->renderSurface()); 601 602 rootDrawLayer->renderSurface()->setContentRect(IntRect(IntPoint(0, 0), m_viewportVisibleRect.size())); 616 617 if (!rootLayer->renderSurface()) 618 rootLayer->createRenderSurface(); 619 rootLayer->renderSurface()->setContentRect(IntRect(IntPoint(0, 0), m_viewportVisibleRect.size())); 603 620 604 621 IntRect rootScissorRect(m_viewportVisibleRect); 605 622 // The scissorRect should not include the scroll offset. 606 623 rootScissorRect.move(-m_viewportScrollPosition.x(), -m_viewportScrollPosition.y()); 607 rootDrawLayer->setScissorRect(rootScissorRect); 608 609 m_defaultRenderSurface = rootDrawLayer->renderSurface(); 610 611 renderSurfaceLayerList.append(rootDrawLayer); 624 rootLayer->setScissorRect(rootScissorRect); 625 626 LayerList renderSurfaceLayerList; 627 renderSurfaceLayerList.append(rootLayer); 628 629 RenderSurfaceChromium* rootRenderSurface = rootLayer->renderSurface(); 630 rootRenderSurface->clearLayerList(); 612 631 613 632 TransformationMatrix identityMatrix; 614 m_defaultRenderSurface->clearLayerList(); 615 // Unfortunately, updatePropertiesAndRenderSurfaces() currently both updates the layers and updates the draw state 616 // (transforms, etc). It'd be nicer if operations on the presentation layers happened later, but the draw 617 // transforms are needed by large layers to determine visibility. Tiling will fix this by eliminating the 618 // concept of a large content layer. 619 updatePropertiesAndRenderSurfaces(rootDrawLayer, identityMatrix, renderSurfaceLayerList, m_defaultRenderSurface->layerList()); 633 634 { 635 TRACE_EVENT("LayerRendererChromium::updateLayers::calcDrawEtc", this, 0); 636 calculateDrawTransformsAndVisibility<LayerChromium, RenderSurfaceChromium, void*>(rootLayer, rootLayer, identityMatrix, renderSurfaceLayerList, rootRenderSurface->layerList(), 0, m_maxTextureSize); 637 } 620 638 621 639 #ifndef NDEBUG … … 662 680 { 663 681 for (int surfaceIndex = renderSurfaceLayerList.size() - 1; surfaceIndex >= 0 ; --surfaceIndex) { 664 CCLayerImpl* renderSurfaceLayer = renderSurfaceLayerList[surfaceIndex].get();682 LayerChromium* renderSurfaceLayer = renderSurfaceLayerList[surfaceIndex].get(); 665 683 RenderSurfaceChromium* renderSurface = renderSurfaceLayer->renderSurface(); 666 684 ASSERT(renderSurface); … … 679 697 continue; 680 698 681 LayerList& layerList = renderSurface->layerList();699 const LayerList& layerList = renderSurface->layerList(); 682 700 ASSERT(layerList.size()); 683 701 for (unsigned layerIndex = 0; layerIndex < layerList.size(); ++layerIndex) { 684 CCLayerImpl* ccLayerImpl= layerList[layerIndex].get();702 LayerChromium* layer = layerList[layerIndex].get(); 685 703 686 704 // Layers that start a new render surface will be painted when the render 687 705 // surface's list is processed. 688 if ( ccLayerImpl->renderSurface() && ccLayerImpl->renderSurface() != renderSurface)706 if (layer->renderSurface() && layer->renderSurface() != renderSurface) 689 707 continue; 690 691 LayerChromium* layer = ccLayerImpl->owner();692 708 693 709 layer->setLayerRenderer(this); … … 707 723 continue; 708 724 709 IntRect targetSurfaceRect = ccLayerImpl->targetRenderSurface() ? ccLayerImpl->targetRenderSurface()->contentRect() : m_defaultRenderSurface->contentRect();710 if (layer-> ccLayerImpl()->usesLayerScissor())711 targetSurfaceRect.intersect(layer-> ccLayerImpl()->scissorRect());712 IntRect visibleLayerRect = calculateVisibleLayerRect(targetSurfaceRect, layer->bounds(), layer->contentBounds(), ccLayerImpl->drawTransform());725 IntRect targetSurfaceRect = layer->targetRenderSurface() ? layer->targetRenderSurface()->contentRect() : m_defaultRenderSurface->contentRect(); 726 if (layer->usesLayerScissor()) 727 targetSurfaceRect.intersect(layer->scissorRect()); 728 IntRect visibleLayerRect = calculateVisibleLayerRect(targetSurfaceRect, layer->bounds(), layer->contentBounds(), layer->drawTransform()); 713 729 714 730 paintContentsIfDirty(layer, visibleLayerRect); … … 729 745 } 730 746 731 void LayerRendererChromium::drawLayers (const LayerList& renderSurfaceLayerList)747 void LayerRendererChromium::drawLayersInternal() 732 748 { 733 749 if (m_viewportVisibleRect.isEmpty() || !m_rootLayer) … … 735 751 736 752 TRACE_EVENT("LayerRendererChromium::drawLayers", this, 0); 737 CCLayerImpl* rootDrawLayer = m_root Layer->ccLayerImpl();753 CCLayerImpl* rootDrawLayer = m_rootCCLayerImpl.get(); 738 754 makeContextCurrent(); 755 756 if (!rootDrawLayer->renderSurface()) 757 rootDrawLayer->createRenderSurface(); 758 rootDrawLayer->renderSurface()->setContentRect(IntRect(IntPoint(0, 0), m_viewportVisibleRect.size())); 759 760 IntRect rootScissorRect(m_viewportVisibleRect); 761 // The scissorRect should not include the scroll offset. 762 rootScissorRect.move(-m_viewportScrollPosition.x(), -m_viewportScrollPosition.y()); 763 rootDrawLayer->setScissorRect(rootScissorRect); 764 765 CCLayerList renderSurfaceLayerList; 766 renderSurfaceLayerList.append(rootDrawLayer); 767 768 TransformationMatrix identityMatrix; 769 m_defaultRenderSurface = rootDrawLayer->renderSurface(); 770 m_defaultRenderSurface->clearLayerList(); 771 772 { 773 TRACE_EVENT("LayerRendererChromium::drawLayersInternal::calcDrawEtc", this, 0); 774 calculateDrawTransformsAndVisibility<CCLayerImpl, CCRenderSurface, CCLayerSorter>(rootDrawLayer, rootDrawLayer, identityMatrix, renderSurfaceLayerList, m_defaultRenderSurface->layerList(), &m_layerSorter, m_maxTextureSize); 775 } 739 776 740 777 // The GL viewport covers the entire visible area, including the scrollbars. … … 775 812 for (int surfaceIndex = renderSurfaceLayerList.size() - 1; surfaceIndex >= 0 ; --surfaceIndex) { 776 813 CCLayerImpl* renderSurfaceLayer = renderSurfaceLayerList[surfaceIndex].get(); 777 RenderSurfaceChromium* renderSurface = renderSurfaceLayer->renderSurface();814 CCRenderSurface* renderSurface = renderSurfaceLayer->renderSurface(); 778 815 ASSERT(renderSurface); 779 816 … … 799 836 } 800 837 801 LayerList& layerList = renderSurface->layerList();838 const CCLayerList& layerList = renderSurface->layerList(); 802 839 for (unsigned layerIndex = 0; layerIndex < layerList.size(); ++layerIndex) 803 840 drawLayer(layerList[layerIndex].get(), renderSurface); … … 919 956 { 920 957 for (int surfaceIndex = renderSurfaceLayerList.size() - 1; surfaceIndex >= 0 ; --surfaceIndex) { 921 CCLayerImpl* renderSurfaceLayer = renderSurfaceLayerList[surfaceIndex].get();958 LayerChromium* renderSurfaceLayer = renderSurfaceLayerList[surfaceIndex].get(); 922 959 RenderSurfaceChromium* renderSurface = renderSurfaceLayer->renderSurface(); 923 960 ASSERT(renderSurface); … … 929 966 ASSERT(layerList.size()); 930 967 for (unsigned layerIndex = 0; layerIndex < layerList.size(); ++layerIndex) { 931 CCLayerImpl* ccLayerImpl= layerList[layerIndex].get();932 if ( ccLayerImpl->renderSurface() && ccLayerImpl->renderSurface() != renderSurface)968 LayerChromium* layer = layerList[layerIndex].get(); 969 if (layer->renderSurface() && layer->renderSurface() != renderSurface) 933 970 continue; 934 971 935 updateCompositorResources( ccLayerImpl);972 updateCompositorResources(layer); 936 973 } 937 974 } 938 975 } 939 976 940 void LayerRendererChromium::updateCompositorResources(CCLayerImpl* ccLayerImpl) 941 { 942 LayerChromium* layer = ccLayerImpl->owner(); 943 977 void LayerRendererChromium::updateCompositorResources(LayerChromium* layer) 978 { 944 979 if (layer->bounds().isEmpty()) 945 980 return; … … 949 984 950 985 if (layer->maskLayer()) 951 updateCompositorResources( ccLayerImpl->maskLayer());986 updateCompositorResources(layer->maskLayer()); 952 987 if (layer->replicaLayer()) 953 updateCompositorResources( ccLayerImpl->replicaLayer());988 updateCompositorResources(layer->replicaLayer()); 954 989 955 990 if (layer->drawsContent()) 956 991 layer->updateCompositorResources(); 957 958 layer->pushPropertiesTo(ccLayerImpl);959 992 } 960 993 … … 966 999 m_compositeOffscreen = compositeOffscreen; 967 1000 968 if (!m_compositeOffscreen && m_root Layer)969 m_root Layer->ccLayerImpl()->clearRenderSurface();1001 if (!m_compositeOffscreen && m_rootCCLayerImpl) 1002 m_rootCCLayerImpl->clearRenderSurface(); 970 1003 } 971 1004 972 1005 LayerTexture* LayerRendererChromium::getOffscreenLayerTexture() 973 1006 { 974 return m_compositeOffscreen ? m_rootLayer->ccLayerImpl()->renderSurface()->contentsTexture() : 0;1007 return m_compositeOffscreen && m_rootCCLayerImpl ? m_rootCCLayerImpl->renderSurface()->contentsTexture() : 0; 975 1008 } 976 1009 … … 989 1022 } 990 1023 991 bool LayerRendererChromium::useRenderSurface( RenderSurfaceChromium* renderSurface)1024 bool LayerRendererChromium::useRenderSurface(CCRenderSurface* renderSurface) 992 1025 { 993 1026 if (m_currentRenderSurface == renderSurface) … … 1023 1056 } 1024 1057 1025 void LayerRendererChromium::drawLayer(CCLayerImpl* layer, RenderSurfaceChromium* targetSurface)1058 void LayerRendererChromium::drawLayer(CCLayerImpl* layer, CCRenderSurface* targetSurface) 1026 1059 { 1027 1060 if (layer->renderSurface() && layer->renderSurface() != targetSurface) { … … 1049 1082 } else 1050 1083 GLC(m_context.get(), m_context->disable(GraphicsContext3D::SCISSOR_TEST)); 1051 1052 1084 1053 1085 if (!layer->doubleSided()) { … … 1142 1174 // start while we do other work. Other programs are created lazily on first access. 1143 1175 m_sharedGeometry = adoptPtr(new GeometryBinding(m_context.get())); 1144 m_renderSurfaceProgram = adoptPtr(new RenderSurfaceChromium::Program(m_context.get()));1176 m_renderSurfaceProgram = adoptPtr(new CCRenderSurface::Program(m_context.get())); 1145 1177 m_tilerProgram = adoptPtr(new LayerTilerChromium::Program(m_context.get())); 1146 1178 … … 1174 1206 } 1175 1207 1176 const RenderSurfaceChromium::Program* LayerRendererChromium::renderSurfaceProgram()1208 const CCRenderSurface::Program* LayerRendererChromium::renderSurfaceProgram() 1177 1209 { 1178 1210 ASSERT(m_renderSurfaceProgram); … … 1184 1216 } 1185 1217 1186 const RenderSurfaceChromium::MaskProgram* LayerRendererChromium::renderSurfaceMaskProgram()1218 const CCRenderSurface::MaskProgram* LayerRendererChromium::renderSurfaceMaskProgram() 1187 1219 { 1188 1220 if (!m_renderSurfaceMaskProgram) 1189 m_renderSurfaceMaskProgram = adoptPtr(new RenderSurfaceChromium::MaskProgram(m_context.get()));1221 m_renderSurfaceMaskProgram = adoptPtr(new CCRenderSurface::MaskProgram(m_context.get())); 1190 1222 if (!m_renderSurfaceMaskProgram->initialized()) { 1191 1223 TRACE_EVENT("LayerRendererChromium::borderProgram::initialize", this, 0); … … 1340 1372 void LayerRendererChromium::dumpRenderSurfaces(TextStream& ts, int indent, LayerChromium* layer) const 1341 1373 { 1342 if (layer-> ccLayerImpl()->renderSurface())1343 layer-> ccLayerImpl()->renderSurface()->dumpSurface(ts, indent);1374 if (layer->renderSurface()) 1375 layer->renderSurface()->dumpSurface(ts, indent); 1344 1376 1345 1377 for (size_t i = 0; i < layer->children().size(); ++i) -
trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h
r92206 r92245 39 39 #include "LayerChromium.h" 40 40 #include "LayerTilerChromium.h" 41 #include "RenderSurfaceChromium.h"42 41 #include "SkBitmap.h" 43 42 #include "VideoLayerChromium.h" … … 130 129 const LayerChromium::BorderProgram* borderProgram(); 131 130 const CCHeadsUpDisplay::Program* headsUpDisplayProgram(); 132 const RenderSurfaceChromium::Program* renderSurfaceProgram();133 const RenderSurfaceChromium::MaskProgram* renderSurfaceMaskProgram();131 const CCRenderSurface::Program* renderSurfaceProgram(); 132 const CCRenderSurface::MaskProgram* renderSurfaceMaskProgram(); 134 133 const LayerTilerChromium::Program* tilerProgram(); 135 134 const LayerTilerChromium::ProgramSwizzle* tilerProgramSwizzle(); … … 161 160 static bool s_inPaintLayerContents; 162 161 #endif 162 typedef Vector<RefPtr<LayerChromium> > LayerList; 163 typedef Vector<RefPtr<CCLayerImpl> > CCLayerList; 164 163 165 protected: 164 166 virtual PassOwnPtr<CCLayerTreeHostImplProxy> createLayerTreeHostImplProxy(); 165 167 166 168 private: 167 typedef Vector<RefPtr<CCLayerImpl> > LayerList;168 169 typedef HashMap<GraphicsContext3D*, int> ChildContextMap; 169 170 … … 173 174 LayerRendererChromium(CCLayerTreeHostClient*, PassRefPtr<GraphicsContext3D>, PassOwnPtr<LayerPainterChromium> contentPaint, bool accelerateDrawing); 174 175 175 void updateLayers(Layer List& renderSurfaceLayerList);176 void updateLayers(LayerChromium*); 176 177 void updateRootLayerContents(); 177 void updatePropertiesAndRenderSurfaces(CCLayerImpl*, const TransformationMatrix& parentMatrix, LayerList& renderSurfaceLayerList, LayerList& layers);178 178 179 179 void paintLayerContents(const LayerList&); 180 180 void updateCompositorResources(const LayerList& renderSurfaceLayerList); 181 void updateCompositorResources( CCLayerImpl*);182 183 void drawLayers (const LayerList& renderSurfaceLayerList);184 void drawLayer(CCLayerImpl*, RenderSurfaceChromium*);181 void updateCompositorResources(LayerChromium*); 182 183 void drawLayersInternal(); 184 void drawLayer(CCLayerImpl*, CCRenderSurface*); 185 185 186 186 void drawRootLayer(); … … 192 192 void setDrawViewportRect(const IntRect&, bool flipY); 193 193 194 bool useRenderSurface( RenderSurfaceChromium*);194 bool useRenderSurface(CCRenderSurface*); 195 195 196 196 bool makeContextCurrent(); … … 220 220 OwnPtr<LayerList> m_computedRenderSurfaceLayerList; 221 221 222 RenderSurfaceChromium* m_currentRenderSurface;222 CCRenderSurface* m_currentRenderSurface; 223 223 unsigned m_offscreenFramebufferId; 224 224 bool m_compositeOffscreen; … … 234 234 OwnPtr<LayerChromium::BorderProgram> m_borderProgram; 235 235 OwnPtr<CCHeadsUpDisplay::Program> m_headsUpDisplayProgram; 236 OwnPtr<RenderSurfaceChromium::Program> m_renderSurfaceProgram;237 OwnPtr<RenderSurfaceChromium::MaskProgram> m_renderSurfaceMaskProgram;238 236 OwnPtr<LayerTilerChromium::Program> m_tilerProgram; 239 237 OwnPtr<LayerTilerChromium::ProgramSwizzle> m_tilerProgramSwizzle; 240 238 OwnPtr<CCCanvasLayerImpl::Program> m_canvasLayerProgram; 239 OwnPtr<CCPluginLayerImpl::Program> m_pluginLayerProgram; 240 OwnPtr<CCRenderSurface::MaskProgram> m_renderSurfaceMaskProgram; 241 OwnPtr<CCRenderSurface::Program> m_renderSurfaceProgram; 241 242 OwnPtr<CCVideoLayerImpl::RGBAProgram> m_videoLayerRGBAProgram; 242 243 OwnPtr<CCVideoLayerImpl::YUVProgram> m_videoLayerYUVProgram; 243 OwnPtr<CCPluginLayerImpl::Program> m_pluginLayerProgram;244 244 245 245 OwnPtr<TextureManager> m_contentsTextureManager; … … 261 261 bool m_animating; 262 262 263 RenderSurfaceChromium* m_defaultRenderSurface;263 CCRenderSurface* m_defaultRenderSurface; 264 264 265 265 CCLayerSorter m_layerSorter; -
trunk/Source/WebCore/platform/graphics/chromium/PluginLayerChromium.cpp
r86652 r92245 50 50 PassRefPtr<CCLayerImpl> PluginLayerChromium::createCCLayerImpl() 51 51 { 52 return CCPluginLayerImpl::create( this,m_layerId);52 return CCPluginLayerImpl::create(m_layerId); 53 53 } 54 54 -
trunk/Source/WebCore/platform/graphics/chromium/RenderSurfaceChromium.cpp
r91629 r92245 30 30 #include "RenderSurfaceChromium.h" 31 31 32 #include "cc/CCLayerImpl.h"33 32 #include "GraphicsContext3D.h" 34 33 #include "LayerChromium.h" 35 34 #include "LayerRendererChromium.h" 36 #include "LayerTexture.h"37 #include "TextStream.h"38 35 #include <wtf/text/CString.h> 39 36 40 37 namespace WebCore { 41 38 42 RenderSurfaceChromium::RenderSurfaceChromium( CCLayerImpl* owningLayer)39 RenderSurfaceChromium::RenderSurfaceChromium(LayerChromium* owningLayer) 43 40 : m_owningLayer(owningLayer) 44 41 , m_maskLayer(0) … … 50 47 RenderSurfaceChromium::~RenderSurfaceChromium() 51 48 { 52 cleanupResources();53 }54 55 void RenderSurfaceChromium::cleanupResources()56 {57 if (!m_contentsTexture)58 return;59 60 ASSERT(layerRenderer());61 62 m_contentsTexture.clear();63 49 } 64 50 … … 78 64 79 65 return drawableContentRect; 80 }81 82 bool RenderSurfaceChromium::prepareContentsTexture()83 {84 IntSize requiredSize(m_contentRect.size());85 TextureManager* textureManager = layerRenderer()->renderSurfaceTextureManager();86 87 if (!m_contentsTexture)88 m_contentsTexture = LayerTexture::create(layerRenderer()->context(), textureManager);89 90 if (m_contentsTexture->isReserved())91 return true;92 93 if (!m_contentsTexture->reserve(requiredSize, GraphicsContext3D::RGBA)) {94 m_skipsDraw = true;95 return false;96 }97 98 m_skipsDraw = false;99 return true;100 }101 102 void RenderSurfaceChromium::releaseContentsTexture()103 {104 if (m_skipsDraw || !m_contentsTexture)105 return;106 m_contentsTexture->unreserve();107 }108 109 void RenderSurfaceChromium::drawSurface(CCLayerImpl* maskLayer, const TransformationMatrix& drawTransform)110 {111 GraphicsContext3D* context3D = layerRenderer()->context();112 113 int shaderMatrixLocation = -1;114 int shaderAlphaLocation = -1;115 const RenderSurfaceChromium::Program* program = layerRenderer()->renderSurfaceProgram();116 const RenderSurfaceChromium::MaskProgram* maskProgram = layerRenderer()->renderSurfaceMaskProgram();117 ASSERT(program && program->initialized());118 bool useMask = false;119 if (maskLayer && maskLayer->drawsContent()) {120 if (!maskLayer->bounds().isEmpty()) {121 context3D->makeContextCurrent();122 GLC(context3D, context3D->useProgram(maskProgram->program()));123 GLC(context3D, context3D->activeTexture(GraphicsContext3D::TEXTURE0));124 GLC(context3D, context3D->uniform1i(maskProgram->fragmentShader().samplerLocation(), 0));125 m_contentsTexture->bindTexture();126 GLC(context3D, context3D->activeTexture(GraphicsContext3D::TEXTURE1));127 GLC(context3D, context3D->uniform1i(maskProgram->fragmentShader().maskSamplerLocation(), 1));128 maskLayer->bindContentsTexture();129 GLC(context3D, context3D->activeTexture(GraphicsContext3D::TEXTURE0));130 shaderMatrixLocation = maskProgram->vertexShader().matrixLocation();131 shaderAlphaLocation = maskProgram->fragmentShader().alphaLocation();132 useMask = true;133 }134 }135 136 if (!useMask) {137 GLC(context3D, context3D->useProgram(program->program()));138 m_contentsTexture->bindTexture();139 GLC(context3D, context3D->uniform1i(program->fragmentShader().samplerLocation(), 0));140 shaderMatrixLocation = program->vertexShader().matrixLocation();141 shaderAlphaLocation = program->fragmentShader().alphaLocation();142 }143 144 LayerChromium::drawTexturedQuad(layerRenderer()->context(), layerRenderer()->projectionMatrix(), drawTransform,145 m_contentRect.width(), m_contentRect.height(), m_drawOpacity,146 shaderMatrixLocation, shaderAlphaLocation);147 }148 149 void RenderSurfaceChromium::draw(const IntRect&)150 {151 if (m_skipsDraw || !m_contentsTexture)152 return;153 // FIXME: By using the same RenderSurface for both the content and its reflection,154 // it's currently not possible to apply a separate mask to the reflection layer155 // or correctly handle opacity in reflections (opacity must be applied after drawing156 // both the layer and its reflection). The solution is to introduce yet another RenderSurface157 // to draw the layer and its reflection in. For now we only apply a separate reflection158 // mask if the contents don't have a mask of their own.159 CCLayerImpl* replicaMaskLayer = m_maskLayer;160 if (!m_maskLayer && m_owningLayer->replicaLayer())161 replicaMaskLayer = m_owningLayer->replicaLayer()->maskLayer();162 163 if (m_owningLayer->parent() && m_owningLayer->parent()->usesLayerScissor())164 layerRenderer()->setScissorToRect(m_scissorRect);165 else166 GLC(layerRenderer()->context(), layerRenderer()->context()->disable(GraphicsContext3D::SCISSOR_TEST));167 168 169 // Reflection draws before the layer.170 if (m_owningLayer->replicaLayer())171 drawSurface(replicaMaskLayer, m_replicaDrawTransform);172 173 drawSurface(m_maskLayer, m_drawTransform);174 }175 176 void RenderSurfaceChromium::clearLayerList()177 {178 m_layerList.clear();179 66 } 180 67 -
trunk/Source/WebCore/platform/graphics/chromium/RenderSurfaceChromium.h
r91322 r92245 40 40 namespace WebCore { 41 41 42 class CCLayerImpl;42 class LayerChromium; 43 43 class LayerRendererChromium; 44 44 class LayerTexture; … … 47 47 WTF_MAKE_NONCOPYABLE(RenderSurfaceChromium); 48 48 public: 49 explicit RenderSurfaceChromium( CCLayerImpl*);49 explicit RenderSurfaceChromium(LayerChromium*); 50 50 ~RenderSurfaceChromium(); 51 51 … … 61 61 FloatRect drawableContentRect() const; 62 62 63 Vector<RefPtr<CCLayerImpl> >& layerList() { return m_layerList; }64 void clearLayerList();65 66 63 const IntRect& contentRect() const { return m_contentRect; } 67 64 void setContentRect(const IntRect& contentRect) { m_contentRect = contentRect; } … … 72 69 const TransformationMatrix& drawTransform() const { return m_drawTransform; } 73 70 void setDrawTransform(const TransformationMatrix& drawTransform) { m_drawTransform = drawTransform; } 74 75 CCLayerImpl* maskLayer() const { return m_maskLayer; }76 void setMaskLayer(CCLayerImpl* maskLayer) { m_maskLayer = maskLayer; }77 71 78 72 const TransformationMatrix& originTransform() const { return m_originTransform; } … … 88 82 void setSkipsDraw(bool skipsDraw) { m_skipsDraw = skipsDraw; } 89 83 90 LayerTexture* contentsTexture() const { return m_contentsTexture.get(); } 84 void clearLayerList() { m_layerList.clear(); } 85 Vector<RefPtr<LayerChromium> >& layerList() { return m_layerList; } 91 86 92 typedef ProgramBinding<VertexShaderPosTex, FragmentShaderRGBATexAlpha> Program; 93 typedef ProgramBinding<VertexShaderPosTex, FragmentShaderRGBATexAlphaMask> MaskProgram; 87 void setMaskLayer(LayerChromium* maskLayer) { m_maskLayer = maskLayer; } 94 88 95 89 private: 96 90 LayerRendererChromium* layerRenderer(); 97 void drawSurface(CCLayerImpl* maskLayer, const TransformationMatrix& drawTransform);98 91 99 CCLayerImpl* m_owningLayer;100 CCLayerImpl* m_maskLayer;92 LayerChromium* m_owningLayer; 93 LayerChromium* m_maskLayer; 101 94 102 95 IntRect m_contentRect; 103 96 bool m_skipsDraw; 104 97 105 OwnPtr<LayerTexture> m_contentsTexture;106 98 float m_drawOpacity; 107 99 TransformationMatrix m_drawTransform; … … 109 101 TransformationMatrix m_originTransform; 110 102 IntRect m_scissorRect; 111 Vector<RefPtr< CCLayerImpl> > m_layerList;103 Vector<RefPtr<LayerChromium> > m_layerList; 112 104 }; 113 105 -
trunk/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp
r90963 r92245 61 61 PassRefPtr<CCLayerImpl> TiledLayerChromium::createCCLayerImpl() 62 62 { 63 return CCTiledLayerImpl::create( this,id());63 return CCTiledLayerImpl::create(id()); 64 64 } 65 65 … … 151 151 TransformationMatrix TiledLayerChromium::tilingTransform() const 152 152 { 153 TransformationMatrix transform = ccLayerImpl()->drawTransform();153 TransformationMatrix transform = drawTransform(); 154 154 155 155 if (contentBounds().isEmpty()) -
trunk/Source/WebCore/platform/graphics/chromium/TreeSynchronizer.cpp
r87868 r92245 75 75 ccLayerImpl->setReplicaLayer(0); 76 76 77 layer->setCCLayerImpl(ccLayerImpl.get());78 79 77 layer->pushPropertiesTo(ccLayerImpl.get()); 80 78 return ccLayerImpl.release(); -
trunk/Source/WebCore/platform/graphics/chromium/VideoLayerChromium.cpp
r91584 r92245 70 70 PassRefPtr<CCLayerImpl> VideoLayerChromium::createCCLayerImpl() 71 71 { 72 return CCVideoLayerImpl::create( this,m_layerId);72 return CCVideoLayerImpl::create(m_layerId); 73 73 } 74 74 -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCCanvasLayerImpl.cpp
r90492 r92245 30 30 #include "cc/CCCanvasLayerImpl.h" 31 31 32 #include "CanvasLayerChromium.h"33 32 #include "GraphicsContext3D.h" 34 33 #include "LayerRendererChromium.h" … … 37 36 namespace WebCore { 38 37 39 CCCanvasLayerImpl::CCCanvasLayerImpl( LayerChromium* owner,int id)40 : CCLayerImpl( owner,id)38 CCCanvasLayerImpl::CCCanvasLayerImpl(int id) 39 : CCLayerImpl(id) 41 40 , m_textureId(0) 42 41 , m_hasAlpha(true) -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCCanvasLayerImpl.h
r90492 r92245 35 35 class CCCanvasLayerImpl : public CCLayerImpl { 36 36 public: 37 static PassRefPtr<CCCanvasLayerImpl> create( LayerChromium* owner,int id)37 static PassRefPtr<CCCanvasLayerImpl> create(int id) 38 38 { 39 return adoptRef(new CCCanvasLayerImpl( owner,id));39 return adoptRef(new CCCanvasLayerImpl(id)); 40 40 } 41 41 virtual ~CCCanvasLayerImpl(); … … 51 51 void setPremultipliedAlpha(bool premultipliedAlpha) { m_premultipliedAlpha = premultipliedAlpha; } 52 52 private: 53 CCCanvasLayerImpl(LayerChromium*,int);53 explicit CCCanvasLayerImpl(int); 54 54 55 55 unsigned m_textureId; -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.cpp
r90963 r92245 33 33 #include "LayerChromium.h" 34 34 #include "LayerRendererChromium.h" 35 #include "RenderSurfaceChromium.h"36 35 #include <wtf/text/WTFString.h> 37 36 … … 61 60 namespace WebCore { 62 61 63 CCLayerImpl::CCLayerImpl(LayerChromium* owner, int id) 64 : m_owner(owner) 65 , m_parent(0) 62 CCLayerImpl::CCLayerImpl(int id) 63 : m_parent(0) 66 64 , m_layerId(id) 67 65 , m_anchorPoint(0.5, 0.5) … … 84 82 CCLayerImpl::~CCLayerImpl() 85 83 { 86 if (m_owner)87 m_owner->setCCLayerImpl(0);88 84 } 89 85 … … 123 119 } 124 120 125 RenderSurfaceChromium*CCLayerImpl::createRenderSurface()126 { 127 m_renderSurface = adoptPtr(new RenderSurfaceChromium(this));128 return m_renderSurface.get();129 } 130 131 bool CCLayerImpl::descendant sDrawsContent()121 void CCLayerImpl::createRenderSurface() 122 { 123 ASSERT(!m_renderSurface); 124 m_renderSurface = adoptPtr(new CCRenderSurface(this)); 125 } 126 127 bool CCLayerImpl::descendantDrawsContent() 132 128 { 133 129 for (size_t i = 0; i < m_children.size(); ++i) { 134 if (m_children[i]->drawsContent() || m_children[i]->descendant sDrawsContent())130 if (m_children[i]->drawsContent() || m_children[i]->descendantDrawsContent()) 135 131 return true; 136 132 } … … 143 139 } 144 140 145 void CCLayerImpl::updateCompositorResources()146 {147 m_owner->updateCompositorResources();148 }149 150 void CCLayerImpl::unreserveContentsTexture()151 {152 m_owner->unreserveContentsTexture();153 }154 155 141 void CCLayerImpl::bindContentsTexture() 156 142 { 157 m_owner->bindContentsTexture();158 143 } 159 144 -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.h
r90963 r92245 32 32 #include "TextStream.h" 33 33 #include "TransformationMatrix.h" 34 #include "cc/CCRenderSurface.h" 34 35 #include <wtf/OwnPtr.h> 35 36 #include <wtf/PassRefPtr.h> … … 41 42 class LayerChromium; 42 43 class LayerRendererChromium; 43 class RenderSurfaceChromium;44 44 45 45 class CCLayerImpl : public RefCounted<CCLayerImpl> { 46 46 public: 47 static PassRefPtr<CCLayerImpl> create( LayerChromium* owner,int id)47 static PassRefPtr<CCLayerImpl> create(int id) 48 48 { 49 return adoptRef(new CCLayerImpl( owner,id));49 return adoptRef(new CCLayerImpl(id)); 50 50 } 51 51 virtual ~CCLayerImpl(); … … 71 71 72 72 virtual void draw(); 73 virtual void updateCompositorResources();74 73 void unreserveContentsTexture(); 75 74 virtual void bindContentsTexture(); … … 80 79 81 80 // Returns true if any of the layer's descendants has content to draw. 82 bool descendant sDrawsContent();81 bool descendantDrawsContent(); 83 82 84 83 void cleanupResources(); … … 125 124 LayerRendererChromium* layerRenderer() const { return m_layerRenderer.get(); } 126 125 127 RenderSurfaceChromium* createRenderSurface(); 128 129 RenderSurfaceChromium* renderSurface() const { return m_renderSurface.get(); } 126 CCRenderSurface* renderSurface() const { return m_renderSurface.get(); } 127 void createRenderSurface(); 130 128 void clearRenderSurface() { m_renderSurface.clear(); } 131 129 … … 135 133 const IntRect& scissorRect() const { return m_scissorRect; } 136 134 void setScissorRect(const IntRect& rect) { m_scissorRect = rect; } 137 138 RenderSurfaceChromium* targetRenderSurface() const { return m_targetRenderSurface; } 139 void setTargetRenderSurface(RenderSurfaceChromium* surface) { m_targetRenderSurface = surface; } 135 CCRenderSurface* targetRenderSurface() const { return m_targetRenderSurface; } 136 void setTargetRenderSurface(CCRenderSurface* surface) { m_targetRenderSurface = surface; } 140 137 141 138 const IntSize& bounds() const { return m_bounds; } … … 161 158 virtual void dumpLayerProperties(TextStream&, int indent) const; 162 159 163 // HACK TODO fix this164 LayerChromium* owner() const { return m_owner; }165 void clearOwner() { m_owner = 0; }166 167 160 protected: 168 // For now, CCLayerImpls have a back pointer to their LayerChromium. 169 // FIXME: remove this after https://bugs.webkit.org/show_bug.cgi?id=58833 is fixed. 170 LayerChromium* m_owner; 171 CCLayerImpl(LayerChromium*, int); 161 explicit CCLayerImpl(int); 172 162 173 163 static void writeIndent(TextStream&, int indent); … … 217 207 // to an ancestor of this layer. The target render surface determines the 218 208 // coordinate system the layer's transforms are relative to. 219 RenderSurfaceChromium* m_targetRenderSurface;209 CCRenderSurface* m_targetRenderSurface; 220 210 221 211 // The global depth value of the center of the layer. This value is used … … 237 227 // Render surface associated with this layer. The layer and its descendants 238 228 // will render to this surface. 239 OwnPtr< RenderSurfaceChromium> m_renderSurface;229 OwnPtr<CCRenderSurface> m_renderSurface; 240 230 241 231 // Hierarchical bounding rect containing the layer and its descendants. -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerSorter.cpp
r90872 r92245 27 27 #include "cc/CCLayerSorter.h" 28 28 29 #include "RenderSurfaceChromium.h"30 29 #include "TransformationMatrix.h" 30 #include "cc/CCRenderSurface.h" 31 31 #include <limits.h> 32 32 … … 279 279 m_nodes.append(GraphNode(it->get())); 280 280 GraphNode& node = m_nodes.at(m_nodes.size() - 1); 281 RenderSurfaceChromium* renderSurface = node.layer->renderSurface();281 CCRenderSurface* renderSurface = node.layer->renderSurface(); 282 282 if (!node.layer->drawsContent() && !renderSurface) 283 283 continue; -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCPluginLayerImpl.cpp
r90492 r92245 32 32 #include "GraphicsContext3D.h" 33 33 #include "LayerRendererChromium.h" 34 #include "PluginLayerChromium.h"35 34 #include <wtf/text/WTFString.h> 36 35 37 36 namespace WebCore { 38 37 39 CCPluginLayerImpl::CCPluginLayerImpl( LayerChromium* owner,int id)40 : CCLayerImpl( owner,id)38 CCPluginLayerImpl::CCPluginLayerImpl(int id) 39 : CCLayerImpl(id) 41 40 , m_textureId(0) 42 41 { -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCPluginLayerImpl.h
r90492 r92245 35 35 class CCPluginLayerImpl : public CCLayerImpl { 36 36 public: 37 static PassRefPtr<CCPluginLayerImpl> create( LayerChromium* owner,int id)37 static PassRefPtr<CCPluginLayerImpl> create(int id) 38 38 { 39 return adoptRef(new CCPluginLayerImpl( owner,id));39 return adoptRef(new CCPluginLayerImpl(id)); 40 40 } 41 41 virtual ~CCPluginLayerImpl(); … … 50 50 51 51 private: 52 CCPluginLayerImpl(LayerChromium*,int);52 explicit CCPluginLayerImpl(int); 53 53 54 54 unsigned m_textureId; -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCRenderSurface.cpp
r92244 r92245 1 1 /* 2 * Copyright (C) 201 0Google Inc. All rights reserved.2 * Copyright (C) 2011 Google Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 28 28 #if USE(ACCELERATED_COMPOSITING) 29 29 30 #include "RenderSurfaceChromium.h" 31 32 #include "cc/CCLayerImpl.h" 30 #include "cc/CCRenderSurface.h" 31 33 32 #include "GraphicsContext3D.h" 34 33 #include "LayerChromium.h" … … 36 35 #include "LayerTexture.h" 37 36 #include "TextStream.h" 37 #include "cc/CCLayerImpl.h" 38 38 #include <wtf/text/CString.h> 39 39 40 40 namespace WebCore { 41 41 42 RenderSurfaceChromium::RenderSurfaceChromium(CCLayerImpl* owningLayer)42 CCRenderSurface::CCRenderSurface(CCLayerImpl* owningLayer) 43 43 : m_owningLayer(owningLayer) 44 44 , m_maskLayer(0) … … 48 48 } 49 49 50 RenderSurfaceChromium::~RenderSurfaceChromium()50 CCRenderSurface::~CCRenderSurface() 51 51 { 52 52 cleanupResources(); 53 53 } 54 54 55 void RenderSurfaceChromium::cleanupResources()55 void CCRenderSurface::cleanupResources() 56 56 { 57 57 if (!m_contentsTexture) … … 63 63 } 64 64 65 LayerRendererChromium* RenderSurfaceChromium::layerRenderer()65 LayerRendererChromium* CCRenderSurface::layerRenderer() 66 66 { 67 67 ASSERT(m_owningLayer); … … 69 69 } 70 70 71 FloatRect RenderSurfaceChromium::drawableContentRect() const71 FloatRect CCRenderSurface::drawableContentRect() const 72 72 { 73 73 FloatRect localContentRect(-0.5 * m_contentRect.width(), -0.5 * m_contentRect.height(), … … 80 80 } 81 81 82 bool RenderSurfaceChromium::prepareContentsTexture()82 bool CCRenderSurface::prepareContentsTexture() 83 83 { 84 84 IntSize requiredSize(m_contentRect.size()); … … 100 100 } 101 101 102 void RenderSurfaceChromium::releaseContentsTexture()102 void CCRenderSurface::releaseContentsTexture() 103 103 { 104 104 if (m_skipsDraw || !m_contentsTexture) … … 107 107 } 108 108 109 void RenderSurfaceChromium::drawSurface(CCLayerImpl* maskLayer, const TransformationMatrix& drawTransform) 109 110 void CCRenderSurface::drawSurface(CCLayerImpl* maskLayer, const TransformationMatrix& drawTransform) 110 111 { 111 112 GraphicsContext3D* context3D = layerRenderer()->context(); … … 113 114 int shaderMatrixLocation = -1; 114 115 int shaderAlphaLocation = -1; 115 const RenderSurfaceChromium::Program* program = layerRenderer()->renderSurfaceProgram();116 const RenderSurfaceChromium::MaskProgram* maskProgram = layerRenderer()->renderSurfaceMaskProgram();116 const CCRenderSurface::Program* program = layerRenderer()->renderSurfaceProgram(); 117 const CCRenderSurface::MaskProgram* maskProgram = layerRenderer()->renderSurfaceMaskProgram(); 117 118 ASSERT(program && program->initialized()); 118 119 bool useMask = false; … … 141 142 shaderAlphaLocation = program->fragmentShader().alphaLocation(); 142 143 } 143 144 144 145 LayerChromium::drawTexturedQuad(layerRenderer()->context(), layerRenderer()->projectionMatrix(), drawTransform, 145 146 m_contentRect.width(), m_contentRect.height(), m_drawOpacity, … … 147 148 } 148 149 149 void RenderSurfaceChromium::draw(const IntRect&)150 void CCRenderSurface::draw(const IntRect&) 150 151 { 151 152 if (m_skipsDraw || !m_contentsTexture) … … 166 167 GLC(layerRenderer()->context(), layerRenderer()->context()->disable(GraphicsContext3D::SCISSOR_TEST)); 167 168 168 169 169 // Reflection draws before the layer. 170 170 if (m_owningLayer->replicaLayer()) … … 174 174 } 175 175 176 void RenderSurfaceChromium::clearLayerList() 177 { 178 m_layerList.clear(); 179 } 180 181 String RenderSurfaceChromium::name() const 182 { 183 return String::format("RenderSurface(id=%d,owner=%s)", m_owningLayer->id(), m_owningLayer->name().utf8().data()); 176 String CCRenderSurface::name() const 177 { 178 return String::format("RenderSurface(id=%i,owner=%s)", m_owningLayer->id(), m_owningLayer->name().utf8().data()); 184 179 } 185 180 … … 190 185 } 191 186 192 void RenderSurfaceChromium::dumpSurface(TextStream& ts, int indent) const187 void CCRenderSurface::dumpSurface(TextStream& ts, int indent) const 193 188 { 194 189 writeIndent(ts, indent); … … 199 194 } 200 195 196 int CCRenderSurface::owningLayerId() const 197 { 198 return m_owningLayer ? m_owningLayer->id() : 0; 199 } 200 201 201 } 202 202 #endif // USE(ACCELERATED_COMPOSITING) -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCRenderSurface.h
r92244 r92245 1 1 /* 2 * Copyright (C) 201 0Google Inc. All rights reserved.2 * Copyright (C) 2011 Google Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 25 25 26 26 27 #ifndef RenderSurfaceChromium_h28 #define RenderSurfaceChromium_h27 #ifndef CCRenderSurface_h 28 #define CCRenderSurface_h 29 29 30 30 #if USE(ACCELERATED_COMPOSITING) … … 44 44 class LayerTexture; 45 45 46 class RenderSurfaceChromium{47 WTF_MAKE_NONCOPYABLE( RenderSurfaceChromium);46 class CCRenderSurface { 47 WTF_MAKE_NONCOPYABLE(CCRenderSurface); 48 48 public: 49 explicit RenderSurfaceChromium(CCLayerImpl*);50 ~ RenderSurfaceChromium();49 explicit CCRenderSurface(CCLayerImpl*); 50 ~CCRenderSurface(); 51 51 52 52 bool prepareContentsTexture(); … … 58 58 void dumpSurface(TextStream&, int indent) const; 59 59 60 FloatPoint contentRectCenter() const { return FloatRect(m_contentRect).center(); } 61 60 62 // Returns the rect that encloses the RenderSurface including any reflection. 61 63 FloatRect drawableContentRect() const; 62 64 65 float drawOpacity() const { return m_drawOpacity; } 66 void setDrawOpacity(float opacity) { m_drawOpacity = opacity; } 67 68 void setDrawTransform(const TransformationMatrix& drawTransform) { m_drawTransform = drawTransform; } 69 const TransformationMatrix& drawTransform() const { return m_drawTransform; } 70 71 void setReplicaDrawTransform(const TransformationMatrix& replicaDrawTransform) { m_replicaDrawTransform = replicaDrawTransform; } 72 const TransformationMatrix& replicaDrawTransform() const { return m_replicaDrawTransform; } 73 74 void setOriginTransform(const TransformationMatrix& originTransform) { m_originTransform = originTransform; } 75 const TransformationMatrix& originTransform() const { return m_originTransform; } 76 77 void setScissorRect(const IntRect& scissorRect) { m_scissorRect = scissorRect; } 78 const IntRect& scissorRect() const { return m_scissorRect; } 79 80 void setContentRect(const IntRect& contentRect) { m_contentRect = contentRect; } 81 const IntRect& contentRect() const { return m_contentRect; } 82 83 void setSkipsDraw(bool skipsDraw) { m_skipsDraw = skipsDraw; } 84 bool skipsDraw() const { return m_skipsDraw; } 85 86 void clearLayerList() { m_layerList.clear(); } 63 87 Vector<RefPtr<CCLayerImpl> >& layerList() { return m_layerList; } 64 void clearLayerList();65 88 66 const IntRect& contentRect() const { return m_contentRect; }67 void setContentRect(const IntRect& contentRect) { m_contentRect = contentRect; }68 69 float drawOpacity() const { return m_drawOpacity; }70 void setDrawOpacity(float drawOpacity) { m_drawOpacity = drawOpacity; }71 72 const TransformationMatrix& drawTransform() const { return m_drawTransform; }73 void setDrawTransform(const TransformationMatrix& drawTransform) { m_drawTransform = drawTransform; }74 75 CCLayerImpl* maskLayer() const { return m_maskLayer; }76 89 void setMaskLayer(CCLayerImpl* maskLayer) { m_maskLayer = maskLayer; } 77 78 const TransformationMatrix& originTransform() const { return m_originTransform; }79 void setOriginTransform(const TransformationMatrix& originTransform) { m_originTransform = originTransform; }80 81 const TransformationMatrix& replicaDrawTransform() const { return m_replicaDrawTransform; }82 void setReplicaDrawTransform(const TransformationMatrix& replicaDrawTransform) { m_replicaDrawTransform = replicaDrawTransform; }83 84 const IntRect& scissorRect() const { return m_scissorRect; }85 void setScissorRect(const IntRect& scissorRect) { m_scissorRect = scissorRect; }86 87 bool skipsDraw() const { return m_skipsDraw; }88 void setSkipsDraw(bool skipsDraw) { m_skipsDraw = skipsDraw; }89 90 LayerTexture* contentsTexture() const { return m_contentsTexture.get(); }91 90 92 91 typedef ProgramBinding<VertexShaderPosTex, FragmentShaderRGBATexAlpha> Program; 93 92 typedef ProgramBinding<VertexShaderPosTex, FragmentShaderRGBATexAlphaMask> MaskProgram; 94 93 94 LayerTexture* contentsTexture() const { return m_contentsTexture.get(); } 95 96 int owningLayerId() const; 95 97 private: 96 98 LayerRendererChromium* layerRenderer(); -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCTiledLayerImpl.cpp
r90963 r92245 30 30 #include "cc/CCTiledLayerImpl.h" 31 31 32 #include "ContentLayerChromium.h"33 34 32 #include <wtf/text/WTFString.h> 35 33 … … 38 36 class LayerTexture; 39 37 40 CCTiledLayerImpl::CCTiledLayerImpl( LayerChromium* owner,int id)41 : CCLayerImpl( owner,id)38 CCTiledLayerImpl::CCTiledLayerImpl(int id) 39 : CCLayerImpl(id) 42 40 , m_tiler(0) 43 41 { -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCTiledLayerImpl.h
r90963 r92245 34 34 class CCTiledLayerImpl : public CCLayerImpl { 35 35 public: 36 static PassRefPtr<CCTiledLayerImpl> create( LayerChromium* owner,int id)36 static PassRefPtr<CCTiledLayerImpl> create(int id) 37 37 { 38 return adoptRef(new CCTiledLayerImpl( owner,id));38 return adoptRef(new CCTiledLayerImpl(id)); 39 39 } 40 40 virtual ~CCTiledLayerImpl(); … … 49 49 50 50 private: 51 CCTiledLayerImpl(LayerChromium*,int id);51 explicit CCTiledLayerImpl(int id); 52 52 53 53 TransformationMatrix m_tilingTransform; -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCVideoLayerImpl.cpp
r90492 r92245 60 60 }; 61 61 62 CCVideoLayerImpl::CCVideoLayerImpl( LayerChromium* owner,int id)63 : CCLayerImpl( owner,id)62 CCVideoLayerImpl::CCVideoLayerImpl(int id) 63 : CCLayerImpl(id) 64 64 { 65 65 } -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCVideoLayerImpl.h
r90492 r92245 39 39 class CCVideoLayerImpl : public CCLayerImpl { 40 40 public: 41 static PassRefPtr<CCVideoLayerImpl> create( LayerChromium* owner,int id)41 static PassRefPtr<CCVideoLayerImpl> create(int id) 42 42 { 43 return adoptRef(new CCVideoLayerImpl( owner,id));43 return adoptRef(new CCVideoLayerImpl(id)); 44 44 } 45 45 virtual ~CCVideoLayerImpl(); … … 57 57 58 58 private: 59 CCVideoLayerImpl(LayerChromium*,int);59 explicit CCVideoLayerImpl(int); 60 60 61 61 void drawYUV(const YUVProgram*) const; -
trunk/Source/WebKit/chromium/tests/TreeSynchronizerTest.cpp
r87868 r92245 37 37 class MockCCLayerImpl : public CCLayerImpl { 38 38 public: 39 static PassRefPtr<MockCCLayerImpl> create( LayerChromium* owner,int layerId)40 { 41 return adoptRef(new MockCCLayerImpl( owner,layerId));39 static PassRefPtr<MockCCLayerImpl> create(int layerId) 40 { 41 return adoptRef(new MockCCLayerImpl(layerId)); 42 42 } 43 43 virtual ~MockCCLayerImpl() … … 50 50 51 51 private: 52 MockCCLayerImpl( LayerChromium* owner,int layerId)53 : CCLayerImpl( owner,layerId)52 MockCCLayerImpl(int layerId) 53 : CCLayerImpl(layerId) 54 54 , m_ccLayerDestructionList(0) 55 55 { … … 70 70 virtual PassRefPtr<CCLayerImpl> createCCLayerImpl() 71 71 { 72 return MockCCLayerImpl::create( this,m_layerId);72 return MockCCLayerImpl::create(m_layerId); 73 73 } 74 74
Note: See TracChangeset
for help on using the changeset viewer.