Changeset 102698 in webkit
- Timestamp:
- Dec 13, 2011 1:12:40 PM (12 years ago)
- Location:
- trunk/Source
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r102697 r102698 1 2011-12-13 Alok Priyadarshi <alokp@chromium.org> 2 3 [chromium] compositing/masks layout tests fail with accelerated drawing 4 https://bugs.webkit.org/show_bug.cgi?id=72760 5 6 Reviewed by Stephen White. 7 8 Accelerated drawing path used to render bottom-up upright textures, which was opposite of what the software path rendered. 9 The textures produced by the accelerated path was flipped along Y in the shader to make it upside down as expected by the compositor. 10 This strategy does not work in case of masks which do not go through a shader and hence do not get flipped, 11 which results in a case where texture in the render surface is top-down, while that in the mask is bottom-up. 12 This patch makes accelerated drawing path render textures in the same orientation as the software path. 13 LayerTextureUpdater::Orientation was added to support the difference in texture orientation between software and accelerated paths. 14 Now that both paths produce textures in the same orientation, there is no need for it. 15 16 No new tests needed. Covered by existing compositing tests. 17 18 * platform/graphics/chromium/BitmapCanvasLayerTextureUpdater.h: 19 * platform/graphics/chromium/BitmapSkPictureCanvasLayerTextureUpdater.h: 20 * platform/graphics/chromium/FrameBufferSkPictureCanvasLayerTextureUpdater.cpp: 21 (WebCore::FrameBufferSkPictureCanvasLayerTextureUpdater::updateTextureRect): 22 * platform/graphics/chromium/FrameBufferSkPictureCanvasLayerTextureUpdater.h: 23 * platform/graphics/chromium/ImageLayerChromium.cpp: 24 * platform/graphics/chromium/LayerTextureUpdater.h: 25 * platform/graphics/chromium/TiledLayerChromium.cpp: 26 (WebCore::TiledLayerChromium::TiledLayerChromium): 27 (WebCore::TiledLayerChromium::setLayerTreeHost): 28 (WebCore::TiledLayerChromium::pushPropertiesTo): 29 * platform/graphics/chromium/TiledLayerChromium.h: 30 * platform/graphics/chromium/cc/CCTiledLayerImpl.cpp: 31 (WebCore::CCTiledLayerImpl::drawTiles): 32 * platform/graphics/chromium/cc/CCTiledLayerImpl.h: 33 (WebCore::CCTiledLayerImpl::setSkipsDraw): 34 1 35 2011-12-09 Zhenyao Mo <zmo@google.com> 2 36 -
trunk/Source/WebCore/platform/graphics/chromium/BitmapCanvasLayerTextureUpdater.h
r101600 r102698 58 58 59 59 virtual PassOwnPtr<LayerTextureUpdater::Texture> createTexture(TextureManager*); 60 virtual Orientation orientation() { return LayerTextureUpdater::BottomUpOrientation; }61 60 virtual SampledTexelFormat sampledTexelFormat(GC3Denum textureFormat); 62 61 virtual void prepareToUpdate(const IntRect& contentRect, const IntSize& tileSize, int borderTexels, float contentsScale); -
trunk/Source/WebCore/platform/graphics/chromium/BitmapSkPictureCanvasLayerTextureUpdater.h
r102181 r102698 57 57 58 58 virtual PassOwnPtr<LayerTextureUpdater::Texture> createTexture(TextureManager*); 59 virtual Orientation orientation() { return LayerTextureUpdater::BottomUpOrientation; }60 59 virtual SampledTexelFormat sampledTexelFormat(GC3Denum textureFormat); 61 60 virtual void prepareToUpdate(const IntRect& contentRect, const IntSize& tileSize, int borderTexels, float contentsScale); -
trunk/Source/WebCore/platform/graphics/chromium/FrameBufferSkPictureCanvasLayerTextureUpdater.cpp
r101600 r102698 148 148 149 149 canvas->clipRect(SkRect(destRect)); 150 // The compositor expects the textures to be upside-down so it can flip 151 // the final composited image. Ganesh renders the image upright so we 152 // need to do a y-flip. 153 canvas->translate(0.0, texture->size().height()); 154 canvas->scale(1.0, -1.0); 150 155 // Translate the origin of contentRect to that of destRect. 151 156 // Note that destRect is defined relative to sourceRect. -
trunk/Source/WebCore/platform/graphics/chromium/FrameBufferSkPictureCanvasLayerTextureUpdater.h
r101600 r102698 54 54 55 55 virtual PassOwnPtr<LayerTextureUpdater::Texture> createTexture(TextureManager*); 56 virtual Orientation orientation() { return LayerTextureUpdater::TopDownOrientation; }57 56 virtual SampledTexelFormat sampledTexelFormat(GC3Denum textureFormat); 58 57 void updateTextureRect(GraphicsContext3D*, TextureAllocator*, ManagedTexture*, const IntRect& sourceRect, const IntRect& destRect); -
trunk/Source/WebCore/platform/graphics/chromium/ImageLayerChromium.cpp
r102180 r102698 78 78 } 79 79 80 virtual Orientation orientation() { return LayerTextureUpdater::BottomUpOrientation; }81 82 80 virtual SampledTexelFormat sampledTexelFormat(GC3Denum textureFormat) 83 81 { -
trunk/Source/WebCore/platform/graphics/chromium/LayerTextureUpdater.h
r101600 r102698 61 61 virtual ~LayerTextureUpdater() { } 62 62 63 enum Orientation {64 BottomUpOrientation,65 TopDownOrientation,66 InvalidOrientation,67 };68 63 enum SampledTexelFormat { 69 64 SampledTexelFormatRGBA, … … 72 67 }; 73 68 virtual PassOwnPtr<Texture> createTexture(TextureManager*) = 0; 74 // Returns the orientation of the texture uploaded by this interface.75 virtual Orientation orientation() = 0;76 69 // Returns the format of the texel uploaded by this interface. 77 70 // This format should not be confused by texture internal format. -
trunk/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp
r102512 r102698 73 73 , m_textureFormat(GraphicsContext3D::INVALID_ENUM) 74 74 , m_skipsDraw(false) 75 , m_textureOrientation(LayerTextureUpdater::InvalidOrientation)76 75 , m_sampledTexelFormat(LayerTextureUpdater::SampledTexelFormatInvalid) 77 76 , m_tilingOption(AutoTile) … … 164 163 165 164 setTextureFormat(host->layerRendererCapabilities().bestTextureFormat); 166 m_textureOrientation = textureUpdater()->orientation();167 165 m_sampledTexelFormat = textureUpdater()->sampledTexelFormat(m_textureFormat); 168 166 } … … 251 249 252 250 tiledLayer->setSkipsDraw(m_skipsDraw); 253 tiledLayer->setTextureOrientation(m_textureOrientation);254 251 tiledLayer->setSampledTexelFormat(m_sampledTexelFormat); 255 252 tiledLayer->setTilingData(*m_tiler); -
trunk/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.h
r101623 r102698 102 102 GC3Denum m_textureFormat; 103 103 bool m_skipsDraw; 104 LayerTextureUpdater::Orientation m_textureOrientation;105 104 LayerTextureUpdater::SampledTexelFormat m_sampledTexelFormat; 106 105 -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCTiledLayerImpl.cpp
r102164 r102698 289 289 float fragmentTexScaleY = clampRect.height() / tileHeight; 290 290 291 // OpenGL coordinate system is bottom-up.292 // If tile texture is top-down, we need to flip the texture coordinates.293 if (m_textureOrientation == LayerTextureUpdater::TopDownOrientation) {294 fragmentTexTranslateY = 1.0 - fragmentTexTranslateY;295 fragmentTexScaleY *= -1.0;296 }297 298 291 CCLayerQuad::Edge edgeX = contentQuad.right(); 299 292 if (i < (m_tiler->numTilesX() - 1)) { -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCTiledLayerImpl.h
r100958 r102698 50 50 51 51 void setSkipsDraw(bool skipsDraw) { m_skipsDraw = skipsDraw; } 52 void setTextureOrientation(LayerTextureUpdater::Orientation textureOrientation) { m_textureOrientation = textureOrientation; }53 52 void setSampledTexelFormat(LayerTextureUpdater::SampledTexelFormat sampledTexelFormat) { m_sampledTexelFormat = sampledTexelFormat; } 54 53 void setTilingData(const CCLayerTilingData& tiler); … … 90 89 91 90 bool m_skipsDraw; 92 LayerTextureUpdater::Orientation m_textureOrientation;93 91 LayerTextureUpdater::SampledTexelFormat m_sampledTexelFormat; 94 92 -
trunk/Source/WebKit/chromium/ChangeLog
r102693 r102698 1 2011-12-13 Alok Priyadarshi <alokp@chromium.org> 2 3 [chromium] compositing/masks layout tests fail with accelerated drawing 4 https://bugs.webkit.org/show_bug.cgi?id=72760 5 6 Reviewed by Stephen White. 7 8 * tests/TiledLayerChromiumTest.cpp: 9 (WTF::FakeLayerTextureUpdater::createTexture): 10 1 11 2011-12-13 Stephen White <senorblanco@chromium.org> 2 12 -
trunk/Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp
r102115 r102698 59 59 60 60 virtual PassOwnPtr<LayerTextureUpdater::Texture> createTexture(TextureManager* manager) { return adoptPtr(new Texture(ManagedTexture::create(manager))); } 61 virtual Orientation orientation() { return BottomUpOrientation; }62 61 virtual SampledTexelFormat sampledTexelFormat(GC3Denum) { return SampledTexelFormatRGBA; } 63 62 virtual void prepareToUpdate(const IntRect&, const IntSize&, int, float) { }
Note: See TracChangeset
for help on using the changeset viewer.