Changeset 90963 in webkit
- Timestamp:
- Jul 13, 2011 4:14:57 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r90961 r90963 1 2011-07-13 James Robinson <jamesr@chromium.org> 2 3 Reviewed by Kenneth Russell. 4 5 [chromium] Move draw implementation for ContentLayerChromium/ImageLayerChromium to the appropriate CCLayerImpl subclass 6 https://bugs.webkit.org/show_bug.cgi?id=58833 7 8 Adds a TiledLayerChromium class to handle the tiling logic shared by ContentLayerChromium and ImageLayerChromium 9 so that they can be siblings in the class hierarchy instead of children. Also adds a CCTiledLayerImpl to handle 10 the drawing responsibilities for tiled layers. 11 12 TiledLayerChromium maintains a tiler, tiling options, and calculates the tiling transform. Subclasses are 13 responsible for providing an appropriate texture updater implementation. CCTiledLayerImpl takes the tiler, 14 tiling transform and layer properties and draws the layer. Longer term it'd be better of the CCTiledLayerImpl 15 owned the tiler and the TiledLayerChromium only owned an updater, but getting there will require changing the 16 way tile eviction works. 17 18 * WebCore.gypi: 19 * platform/graphics/chromium/ContentLayerChromium.cpp: 20 (WebCore::ContentLayerChromium::ContentLayerChromium): 21 (WebCore::ContentLayerChromium::paintContentsIfDirty): 22 (WebCore::ContentLayerChromium::drawsContent): 23 * platform/graphics/chromium/ContentLayerChromium.h: 24 (WebCore::ContentLayerChromium::textureUpdater): 25 * platform/graphics/chromium/ImageLayerChromium.cpp: 26 (WebCore::ImageLayerChromium::ImageLayerChromium): 27 (WebCore::ImageLayerChromium::cleanupResources): 28 (WebCore::ImageLayerChromium::paintContentsIfDirty): 29 (WebCore::ImageLayerChromium::textureUpdater): 30 (WebCore::ImageLayerChromium::contentBounds): 31 (WebCore::ImageLayerChromium::drawsContent): 32 (WebCore::ImageLayerChromium::createTextureUpdaterIfNeeded): 33 * platform/graphics/chromium/ImageLayerChromium.h: 34 * platform/graphics/chromium/LayerChromium.cpp: 35 (WebCore::LayerChromium::pushPropertiesTo): 36 (WebCore::LayerChromium::ccLayerImpl): 37 * platform/graphics/chromium/LayerChromium.h: 38 * platform/graphics/chromium/LayerRendererChromium.cpp: 39 (WebCore::LayerRendererChromium::drawRootLayer): 40 * platform/graphics/chromium/LayerTilerChromium.cpp: 41 (WebCore::LayerTilerChromium::updateRect): 42 (WebCore::LayerTilerChromium::draw): 43 (WebCore::LayerTilerChromium::drawTiles): 44 * platform/graphics/chromium/LayerTilerChromium.h: 45 * platform/graphics/chromium/TiledLayerChromium.cpp: Added. 46 (WebCore::TiledLayerChromium::TiledLayerChromium): 47 (WebCore::TiledLayerChromium::~TiledLayerChromium): 48 (WebCore::TiledLayerChromium::createCCLayerImpl): 49 (WebCore::TiledLayerChromium::cleanupResources): 50 (WebCore::TiledLayerChromium::setLayerRenderer): 51 (WebCore::TiledLayerChromium::updateTileSizeAndTilingOption): 52 (WebCore::TiledLayerChromium::drawsContent): 53 (WebCore::TiledLayerChromium::createTilerIfNeeded): 54 (WebCore::TiledLayerChromium::updateCompositorResources): 55 (WebCore::TiledLayerChromium::setTilingOption): 56 (WebCore::TiledLayerChromium::setIsMask): 57 (WebCore::TiledLayerChromium::tilingTransform): 58 (WebCore::TiledLayerChromium::pushPropertiesTo): 59 (WebCore::writeIndent): 60 (WebCore::TiledLayerChromium::dumpLayerProperties): 61 * platform/graphics/chromium/TiledLayerChromium.h: Added. 62 * platform/graphics/chromium/cc/CCLayerImpl.cpp: 63 (WebCore::CCLayerImpl::draw): 64 * platform/graphics/chromium/cc/CCLayerImpl.h: 65 (WebCore::CCLayerImpl::setDrawsContent): 66 (WebCore::CCLayerImpl::drawsContent): 67 * platform/graphics/chromium/cc/CCTiledLayerImpl.cpp: Added. 68 (WebCore::CCTiledLayerImpl::CCTiledLayerImpl): 69 (WebCore::CCTiledLayerImpl::~CCTiledLayerImpl): 70 (WebCore::CCTiledLayerImpl::draw): 71 (WebCore::CCTiledLayerImpl::bindContentsTexture): 72 (WebCore::CCTiledLayerImpl::dumpLayerProperties): 73 * platform/graphics/chromium/cc/CCTiledLayerImpl.h: Added. 74 (WebCore::CCTiledLayerImpl::create): 75 (WebCore::CCTiledLayerImpl::setTilingTransform): 76 (WebCore::CCTiledLayerImpl::setTiler): 77 1 78 2011-07-13 Julien Chaffraix <jchaffraix@webkit.org> 2 79 -
trunk/Source/WebCore/WebCore.gypi
r90911 r90963 4143 4143 'platform/graphics/chromium/TextureManager.cpp', 4144 4144 'platform/graphics/chromium/TextureManager.h', 4145 'platform/graphics/chromium/TiledLayerChromium.cpp', 4146 'platform/graphics/chromium/TiledLayerChromium.h', 4145 4147 'platform/graphics/chromium/TransparencyWin.cpp', 4146 4148 'platform/graphics/chromium/TransparencyWin.h', … … 4184 4186 'platform/graphics/chromium/cc/CCThread.h', 4185 4187 'platform/graphics/chromium/cc/CCThreadTask.h', 4188 'platform/graphics/chromium/cc/CCTiledLayerImpl.cpp', 4189 'platform/graphics/chromium/cc/CCTiledLayerImpl.h', 4186 4190 'platform/graphics/chromium/cc/CCVideoLayerImpl.cpp', 4187 4191 'platform/graphics/chromium/cc/CCVideoLayerImpl.h', -
trunk/Source/WebCore/platform/graphics/chromium/ContentLayerChromium.cpp
r90859 r90963 35 35 #include "ContentLayerChromium.h" 36 36 37 #include "cc/CCLayerImpl.h"38 #include "GraphicsContext3D.h"39 37 #include "LayerPainterChromium.h" 40 38 #include "LayerRendererChromium.h" 41 #include "LayerTexture.h"42 39 #include "LayerTextureUpdaterCanvas.h" 43 #include "LayerTilerChromium.h"44 40 #include "PlatformBridge.h" 45 #include "RenderLayerBacking.h"46 #include "TextStream.h"47 41 #include <wtf/CurrentTime.h> 48 49 // Start tiling when the width and height of a layer are larger than this size.50 static int maxUntiledSize = 510;51 52 // When tiling is enabled, use tiles of this dimension squared.53 static int defaultTileSize = 256;54 55 using namespace std;56 42 57 43 namespace WebCore { … … 91 77 92 78 ContentLayerChromium::ContentLayerChromium(GraphicsLayerChromium* owner) 93 : LayerChromium(owner) 94 , m_tilingOption(ContentLayerChromium::AutoTile) 95 , m_borderTexels(true) 79 : TiledLayerChromium(owner) 96 80 { 97 81 } … … 107 91 ASSERT(layerRenderer()); 108 92 109 update LayerSize();93 updateTileSizeAndTilingOption(); 110 94 111 95 const IntRect& layerRect = visibleLayerRect(); … … 120 104 return; 121 105 122 m_tiler->prepareToUpdate(layerRect, m_textureUpdater.get());106 m_tiler->prepareToUpdate(layerRect, textureUpdater()); 123 107 m_dirtyRect = FloatRect(); 124 108 } 125 109 126 void ContentLayerChromium::cleanupResources() 110 bool ContentLayerChromium::drawsContent() const 127 111 { 128 m_textureUpdater.clear(); 129 m_tiler.clear(); 130 LayerChromium::cleanupResources(); 131 } 132 133 void ContentLayerChromium::setLayerRenderer(LayerRendererChromium* layerRenderer) 134 { 135 LayerChromium::setLayerRenderer(layerRenderer); 136 createTilerIfNeeded(); 112 return m_owner && m_owner->drawsContent() && TiledLayerChromium::drawsContent(); 137 113 } 138 114 … … 150 126 } 151 127 152 TransformationMatrix ContentLayerChromium::tilingTransform()153 {154 TransformationMatrix transform = ccLayerImpl()->drawTransform();155 156 if (contentBounds().isEmpty())157 return transform;158 159 transform.scaleNonUniform(bounds().width() / static_cast<double>(contentBounds().width()),160 bounds().height() / static_cast<double>(contentBounds().height()));161 162 // Tiler draws with a different origin from other layers.163 transform.translate(-contentBounds().width() / 2.0, -contentBounds().height() / 2.0);164 165 return transform;166 }167 168 IntSize ContentLayerChromium::contentBounds() const169 {170 return bounds();171 }172 173 void ContentLayerChromium::updateLayerSize()174 {175 if (!m_tiler)176 return;177 178 const IntSize tileSize(defaultTileSize, defaultTileSize);179 180 // Tile if both dimensions large, or any one dimension large and the other181 // extends into a second tile. This heuristic allows for long skinny layers182 // (e.g. scrollbars) that are Nx1 tiles to minimize wasted texture space.183 const bool anyDimensionLarge = contentBounds().width() > maxUntiledSize || contentBounds().height() > maxUntiledSize;184 const bool anyDimensionOneTile = contentBounds().width() <= defaultTileSize || contentBounds().height() <= defaultTileSize;185 const bool autoTiled = anyDimensionLarge && !anyDimensionOneTile;186 187 bool isTiled;188 if (m_tilingOption == AlwaysTile)189 isTiled = true;190 else if (m_tilingOption == NeverTile)191 isTiled = false;192 else193 isTiled = autoTiled;194 195 // Empty tile size tells the tiler to avoid tiling.196 IntSize requestedSize = isTiled ? tileSize : IntSize();197 const int maxSize = layerRenderer()->maxTextureSize();198 IntSize clampedSize = requestedSize.shrunkTo(IntSize(maxSize, maxSize));199 m_tiler->setTileSize(clampedSize);200 }201 202 void ContentLayerChromium::draw()203 {204 const IntRect& layerRect = visibleLayerRect();205 if (!layerRect.isEmpty())206 m_tiler->draw(layerRect, tilingTransform(), ccLayerImpl()->drawOpacity(), m_textureUpdater.get());207 }208 209 bool ContentLayerChromium::drawsContent() const210 {211 if (!m_owner || !m_owner->drawsContent())212 return false;213 214 if (!m_tiler)215 return true;216 217 if (m_tilingOption == NeverTile && m_tiler->numTiles() > 1)218 return false;219 220 return !m_tiler->skipsDraw();221 }222 223 void ContentLayerChromium::createTilerIfNeeded()224 {225 if (m_tiler)226 return;227 228 createTextureUpdaterIfNeeded();229 230 m_tiler = LayerTilerChromium::create(231 layerRenderer(),232 IntSize(defaultTileSize, defaultTileSize),233 m_borderTexels ? LayerTilerChromium::HasBorderTexels :234 LayerTilerChromium::NoBorderTexels);235 }236 237 void ContentLayerChromium::updateCompositorResources()238 {239 m_tiler->updateRect(m_textureUpdater.get());240 }241 242 void ContentLayerChromium::setTilingOption(TilingOption option)243 {244 m_tilingOption = option;245 updateLayerSize();246 }247 248 void ContentLayerChromium::bindContentsTexture()249 {250 // This function is only valid for single texture layers, e.g. masks.251 ASSERT(m_tilingOption == NeverTile);252 ASSERT(m_tiler);253 254 LayerTexture* texture = m_tiler->getSingleTexture();255 ASSERT(texture);256 257 texture->bindTexture();258 }259 260 void ContentLayerChromium::setIsMask(bool isMask)261 {262 m_borderTexels = false;263 setTilingOption(isMask ? NeverTile : AutoTile);264 }265 266 static void writeIndent(TextStream& ts, int indent)267 {268 for (int i = 0; i != indent; ++i)269 ts << " ";270 }271 272 void ContentLayerChromium::dumpLayerProperties(TextStream& ts, int indent) const273 {274 LayerChromium::dumpLayerProperties(ts, indent);275 writeIndent(ts, indent);276 ts << "skipsDraw: " << (!m_tiler || m_tiler->skipsDraw()) << "\n";277 }278 279 128 } 280 129 #endif // USE(ACCELERATED_COMPOSITING) -
trunk/Source/WebCore/platform/graphics/chromium/ContentLayerChromium.h
r90859 r90963 35 35 #if USE(ACCELERATED_COMPOSITING) 36 36 37 #include "LayerChromium.h" 37 #include "TiledLayerChromium.h" 38 #include "cc/CCTiledLayerImpl.h" 38 39 39 40 namespace WebCore { … … 44 45 45 46 // A Layer that requires a GraphicsContext to render its contents. 46 class ContentLayerChromium : public LayerChromium { 47 friend class LayerRendererChromium; 47 class ContentLayerChromium : public TiledLayerChromium { 48 48 public: 49 enum TilingOption { AlwaysTile, NeverTile, AutoTile };50 51 49 static PassRefPtr<ContentLayerChromium> create(GraphicsLayerChromium* owner = 0); 52 50 … … 54 52 55 53 virtual void paintContentsIfDirty(); 56 virtual void updateCompositorResources();57 virtual void setIsMask(bool);58 virtual void bindContentsTexture();59 54 60 virtual void draw(); 61 virtual bool drawsContent() const; 62 63 protected: 55 private: 64 56 explicit ContentLayerChromium(GraphicsLayerChromium* owner); 65 57 66 58 virtual const char* layerTypeAsString() const { return "ContentLayer"; } 67 virtual void dumpLayerProperties(TextStream&, int indent) const;68 59 69 virtual void cleanupResources(); 70 virtual void setLayerRenderer(LayerRendererChromium*); 71 72 virtual IntSize contentBounds() const; 73 74 TransformationMatrix tilingTransform(); 75 76 void updateLayerSize(); 77 void createTilerIfNeeded(); 60 virtual bool drawsContent() const; 78 61 virtual void createTextureUpdaterIfNeeded(); 79 v oid setTilingOption(TilingOption);62 virtual LayerTextureUpdater* textureUpdater() const { return m_textureUpdater.get(); } 80 63 81 64 OwnPtr<LayerTextureUpdater> m_textureUpdater; 82 OwnPtr<LayerTilerChromium> m_tiler;83 TilingOption m_tilingOption;84 bool m_borderTexels;85 65 }; 86 66 -
trunk/Source/WebCore/platform/graphics/chromium/ImageLayerChromium.cpp
r90859 r90963 116 116 117 117 ImageLayerChromium::ImageLayerChromium(GraphicsLayerChromium* owner) 118 : ContentLayerChromium(owner)118 : TiledLayerChromium(owner) 119 119 , m_imageForCurrentFrame(0) 120 , m_contents(0)121 120 { 122 121 } … … 124 123 ImageLayerChromium::~ImageLayerChromium() 125 124 { 125 } 126 127 void ImageLayerChromium::cleanupResources() 128 { 129 m_textureUpdater.clear(); 130 TiledLayerChromium::cleanupResources(); 126 131 } 127 132 … … 146 151 147 152 if (!m_dirtyRect.isEmpty()) { 148 // FIXME: This downcast is bad. The fix is to make ImageLayerChromium not derive from ContentLayerChromium. 149 ImageLayerTextureUpdater* imageTextureUpdater = static_cast<ImageLayerTextureUpdater*>(m_textureUpdater.get()); 150 imageTextureUpdater->updateFromImage(m_contents->nativeImageForCurrentFrame()); 151 updateLayerSize(); 153 m_textureUpdater->updateFromImage(m_contents->nativeImageForCurrentFrame()); 154 updateTileSizeAndTilingOption(); 152 155 IntRect paintRect(IntPoint(), contentBounds()); 153 156 if (!m_dirtyRect.isEmpty()) { … … 157 160 } 158 161 162 if (visibleLayerRect().isEmpty()) 163 return; 164 159 165 m_tiler->prepareToUpdate(visibleLayerRect(), m_textureUpdater.get()); 160 166 } 161 167 162 void ImageLayerChromium::updateCompositorResources() 168 LayerTextureUpdater* ImageLayerChromium::textureUpdater() const 163 169 { 164 m_tiler->updateRect(m_textureUpdater.get()); 170 return m_textureUpdater.get(); 171 } 172 173 IntSize ImageLayerChromium::contentBounds() const 174 { 175 if (!m_contents) 176 return IntSize(); 177 return m_contents->size(); 178 } 179 180 bool ImageLayerChromium::drawsContent() const 181 { 182 return m_contents && TiledLayerChromium::drawsContent(); 165 183 } 166 184 … … 171 189 } 172 190 173 IntSize ImageLayerChromium::contentBounds() const174 {175 return m_contents->size();176 }177 178 191 } 179 192 #endif // USE(ACCELERATED_COMPOSITING) -
trunk/Source/WebCore/platform/graphics/chromium/ImageLayerChromium.h
r90859 r90963 45 45 46 46 class Image; 47 class ImageLayerTextureUpdater; 47 48 48 49 // A Layer that contains only an Image element. 49 class ImageLayerChromium : public ContentLayerChromium {50 class ImageLayerChromium : public TiledLayerChromium { 50 51 public: 51 52 static PassRefPtr<ImageLayerChromium> create(GraphicsLayerChromium* owner = 0); 52 53 virtual ~ImageLayerChromium(); 53 54 55 virtual bool drawsContent() const; 54 56 virtual void paintContentsIfDirty(); 55 virtual void updateCompositorResources();56 virtual bool drawsContent() const { return m_contents; }57 57 58 58 void setContents(Image* image); … … 61 61 virtual const char* layerTypeAsString() const { return "ImageLayer"; } 62 62 63 virtual IntSize contentBounds() const;64 65 63 private: 66 64 ImageLayerChromium(GraphicsLayerChromium* owner); 67 65 66 virtual void cleanupResources(); 68 67 virtual void createTextureUpdaterIfNeeded(); 68 void setTilingOption(TilingOption); 69 70 virtual LayerTextureUpdater* textureUpdater() const; 71 virtual IntSize contentBounds() const; 69 72 70 73 NativeImagePtr m_imageForCurrentFrame; 71 74 RefPtr<Image> m_contents; 75 76 OwnPtr<ImageLayerTextureUpdater> m_textureUpdater; 72 77 }; 73 78 -
trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp
r90859 r90963 296 296 layer->setDebugBorderWidth(m_debugBorderWidth); 297 297 layer->setDoubleSided(m_doubleSided); 298 layer->setDrawsContent(drawsContent()); 298 299 layer->setLayerRenderer(m_layerRenderer.get()); 299 300 layer->setMasksToBounds(m_masksToBounds); … … 384 385 } 385 386 386 CCLayerImpl* LayerChromium::ccLayerImpl() 387 CCLayerImpl* LayerChromium::ccLayerImpl() const 387 388 { 388 389 return m_ccLayerImpl; -
trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.h
r90859 r90963 162 162 virtual void unreserveContentsTexture() { } 163 163 virtual void bindContentsTexture() { } 164 virtual void draw() { }165 164 166 165 // These exists just for debugging (via drawDebugBorder()). … … 173 172 174 173 // Everything from here down in the public section will move to CCLayerImpl. 175 CCLayerImpl* ccLayerImpl() ;174 CCLayerImpl* ccLayerImpl() const; 176 175 177 176 static void drawTexturedQuad(GraphicsContext3D*, const TransformationMatrix& projectionMatrix, const TransformationMatrix& layerMatrix, -
trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
r90859 r90963 228 228 scroll.translate(-m_viewportVisibleRect.x(), -m_viewportVisibleRect.y()); 229 229 230 m_rootLayerContentTiler->draw(m_viewportVisibleRect, scroll, 1.0f , m_rootLayerTextureUpdater.get());230 m_rootLayerContentTiler->draw(m_viewportVisibleRect, scroll, 1.0f); 231 231 } 232 232 … … 963 963 updateCompositorResources(ccLayerImpl->replicaLayer()); 964 964 965 if ( ccLayerImpl->drawsContent())966 ccLayerImpl->updateCompositorResources();965 if (layer->drawsContent()) 966 layer->updateCompositorResources(); 967 967 968 968 layer->pushPropertiesTo(ccLayerImpl); -
trunk/Source/WebCore/platform/graphics/chromium/LayerTextureUpdater.h
r89647 r90963 46 46 enum Orientation { 47 47 BottomUpOrientation, 48 TopDownOrientation 48 TopDownOrientation, 49 InvalidOrientation, 49 50 }; 50 51 enum SampledTexelFormat { 51 52 SampledTexelFormatRGBA, 52 SampledTexelFormatBGRA 53 SampledTexelFormatBGRA, 54 SampledTexelFormatInvalid, 53 55 }; 54 56 // Returns the orientation of the texture uploaded by this interface. -
trunk/Source/WebCore/platform/graphics/chromium/LayerTilerChromium.cpp
r90887 r90963 58 58 : m_textureFormat(PlatformColor::bestTextureFormat(layerRenderer->context())) 59 59 , m_skipsDraw(false) 60 , m_textureOrientation(LayerTextureUpdater::InvalidOrientation) 61 , m_sampledTexelFormat(LayerTextureUpdater::SampledTexelFormatInvalid) 60 62 , m_tilingData(max(tileSize.width(), tileSize.height()), 0, 0, border == HasBorderTexels) 61 63 , m_layerRenderer(layerRenderer) … … 327 329 328 330 GraphicsContext3D* context = layerRendererContext(); 331 m_textureOrientation = textureUpdater->orientation(); 332 m_sampledTexelFormat = textureUpdater->sampledTexelFormat(m_textureFormat); 329 333 330 334 int left, top, right, bottom; … … 386 390 } 387 391 388 void LayerTilerChromium::draw(const IntRect& contentRect, const TransformationMatrix& globalTransform, float opacity , LayerTextureUpdater* textureUpdater)392 void LayerTilerChromium::draw(const IntRect& contentRect, const TransformationMatrix& globalTransform, float opacity) 389 393 { 390 394 if (m_skipsDraw || !m_tiles.size() || contentRect.isEmpty()) 391 395 return; 392 396 393 switch ( textureUpdater->sampledTexelFormat(m_textureFormat)) {397 switch (m_sampledTexelFormat) { 394 398 case LayerTextureUpdater::SampledTexelFormatRGBA: 395 drawTiles(contentRect, globalTransform, opacity, layerRenderer()->tilerProgram() , textureUpdater);399 drawTiles(contentRect, globalTransform, opacity, layerRenderer()->tilerProgram()); 396 400 break; 397 401 case LayerTextureUpdater::SampledTexelFormatBGRA: 398 drawTiles(contentRect, globalTransform, opacity, layerRenderer()->tilerProgramSwizzle() , textureUpdater);402 drawTiles(contentRect, globalTransform, opacity, layerRenderer()->tilerProgramSwizzle()); 399 403 break; 400 404 default: … … 454 458 455 459 template <class T> 456 void LayerTilerChromium::drawTiles(const IntRect& contentRect, const TransformationMatrix& globalTransform, float opacity, const T* program , LayerTextureUpdater* textureUpdater)460 void LayerTilerChromium::drawTiles(const IntRect& contentRect, const TransformationMatrix& globalTransform, float opacity, const T* program) 457 461 { 458 462 GraphicsContext3D* context = layerRendererContext(); … … 552 556 // OpenGL coordinate system is bottom-up. 553 557 // If tile texture is top-down, we need to flip the texture coordinates. 554 if ( textureUpdater->orientation()== LayerTextureUpdater::TopDownOrientation) {558 if (m_textureOrientation == LayerTextureUpdater::TopDownOrientation) { 555 559 texTranslateY = 1.0 - texTranslateY; 556 560 texScaleY *= -1.0; -
trunk/Source/WebCore/platform/graphics/chromium/LayerTilerChromium.h
r90859 r90963 32 32 #include "LayerChromium.h" 33 33 #include "LayerTexture.h" 34 #include "LayerTextureUpdater.h" 34 35 #include "TilingData.h" 35 36 #include <wtf/HashTraits.h> … … 60 61 void updateRect(LayerTextureUpdater*); 61 62 // Draw all tiles that intersect with the content rect. 62 void draw(const IntRect& contentRect, const TransformationMatrix&, float opacity , LayerTextureUpdater*);63 void draw(const IntRect& contentRect, const TransformationMatrix&, float opacity); 63 64 64 65 int numTiles() const { return m_tilingData.numTiles(); } … … 110 111 // Draw all tiles that intersect with contentRect. 111 112 template <class T> 112 void drawTiles(const IntRect& contentRect, const TransformationMatrix&, float opacity, const T* program , LayerTextureUpdater*);113 void drawTiles(const IntRect& contentRect, const TransformationMatrix&, float opacity, const T* program); 113 114 114 115 template <class T> … … 166 167 IntRect m_updateRect; 167 168 169 LayerTextureUpdater::Orientation m_textureOrientation; 170 LayerTextureUpdater::SampledTexelFormat m_sampledTexelFormat; 168 171 TilingData m_tilingData; 169 172 -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.cpp
r90859 r90963 72 72 , m_preserves3D(false) 73 73 , m_usesLayerScissor(false) 74 , m_drawsContent(false) 74 75 , m_targetRenderSurface(0) 75 76 , m_drawDepth(0) … … 137 138 } 138 139 139 // These belong on CCLayerImpl, but should be overridden by each type and not defer to the LayerChromium subtypes.140 bool CCLayerImpl::drawsContent() const141 {142 return m_owner->drawsContent();143 }144 145 140 void CCLayerImpl::draw() 146 141 { 147 return m_owner->draw();142 ASSERT_NOT_REACHED(); 148 143 } 149 144 -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.h
r90859 r90963 73 73 virtual void updateCompositorResources(); 74 74 void unreserveContentsTexture(); 75 v oid bindContentsTexture();75 virtual void bindContentsTexture(); 76 76 77 77 // Returns true if this layer has content to draw. 78 virtual bool drawsContent() const; 78 void setDrawsContent(bool drawsContent) { m_drawsContent = drawsContent; } 79 bool drawsContent() const { return m_drawsContent; } 79 80 80 81 // Returns true if any of the layer's descendants has content to draw. … … 202 203 bool m_usesLayerScissor; 203 204 205 bool m_drawsContent; 206 204 207 // Properties owned exclusively by this CCLayerImpl. 205 208 // Debugging.
Note: See TracChangeset
for help on using the changeset viewer.