Changeset 148953 in webkit
- Timestamp:
- Apr 23, 2013 2:02:03 AM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r148952 r148953 1 2013-04-23 Noam Rosenthal <noam@webkit.org> 2 3 [Texmap] Don't paint to an intermediate surface when the result is going to be clipped out completely. 4 https://bugs.webkit.org/show_bug.cgi?id=115015 5 6 Reviewed by Allan Sandfeld Jensen. 7 8 Maintain a clipBounds rectangle in TextureMapper, and test it against the bounds of an intermediate 9 surface before it is painted. 10 This allows us to opt out completely of painting into the surface if the result is going to be optimized 11 out by the GPU clipping. 12 13 Covered by tests in compositing/overlap-blending. 14 15 * platform/graphics/texmap/TextureMapper.h: 16 (TextureMapper): 17 * platform/graphics/texmap/TextureMapperGL.cpp: 18 (WebCore::TextureMapperGL::clipBounds): 19 (WebCore): 20 * platform/graphics/texmap/TextureMapperGL.h: 21 * platform/graphics/texmap/TextureMapperImageBuffer.h: 22 * platform/graphics/texmap/TextureMapperLayer.cpp: 23 (WebCore::TextureMapperLayer::paintUsingOverlapRegions): 24 1 25 2013-04-23 Noam Rosenthal <noam@webkit.org> 2 26 -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapper.h
r148748 r148953 148 148 virtual void beginClip(const TransformationMatrix&, const FloatRect&) = 0; 149 149 virtual void endClip() = 0; 150 virtual IntRect clipBounds() = 0; 150 151 virtual PassRefPtr<BitmapTexture> createTexture() = 0; 151 152 -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp
r148748 r148953 1199 1199 } 1200 1200 1201 IntRect TextureMapperGL::clipBounds() 1202 { 1203 return clipStack().current().scissorBox; 1204 } 1205 1201 1206 PassRefPtr<BitmapTexture> TextureMapperGL::createTexture() 1202 1207 { -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGL.h
r148090 r148953 65 65 virtual void endPainting() OVERRIDE; 66 66 virtual void endClip() OVERRIDE; 67 virtual IntRect clipBounds() OVERRIDE; 67 68 virtual IntSize maxTextureSize() const OVERRIDE { return IntSize(2000, 2000); } 68 69 virtual PassRefPtr<BitmapTexture> createTexture() OVERRIDE; -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapperImageBuffer.h
r144190 r148953 61 61 virtual void bindSurface(BitmapTexture* surface) OVERRIDE { m_currentSurface = surface;} 62 62 virtual void endClip() OVERRIDE { graphicsContext()->restore(); } 63 virtual IntRect clipBounds() OVERRIDE { return currentContext()->clipBounds(); } 63 64 virtual IntSize maxTextureSize() const; 64 65 virtual PassRefPtr<BitmapTexture> createTexture() OVERRIDE { return BitmapTextureImageBuffer::create(); } -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp
r148945 r148953 360 360 } 361 361 362 Vector<IntRect> rects;363 364 362 nonOverlapRegion.translate(options.offset); 365 rects = nonOverlapRegion.rects();363 Vector<IntRect> rects = nonOverlapRegion.rects(); 366 364 for (size_t i = 0; i < rects.size(); ++i) { 365 IntRect rect = rects[i]; 366 if (!rect.intersects(options.textureMapper->clipBounds())) 367 continue; 368 367 369 options.textureMapper->beginClip(TransformationMatrix(), rects[i]); 368 370 paintSelfAndChildrenWithReplica(options); … … 372 374 rects = overlapRegion.rects(); 373 375 IntSize maxTextureSize = options.textureMapper->maxTextureSize(); 374 IntRect rect; 376 IntRect adjustedClipBounds(options.textureMapper->clipBounds()); 377 adjustedClipBounds.move(-options.offset); 375 378 for (size_t i = 0; i < rects.size(); ++i) { 376 rect = rects[i];379 IntRect rect = rects[i]; 377 380 for (int x = rect.x(); x < rect.maxX(); x += maxTextureSize.width()) { 378 381 for (int y = rect.y(); y < rect.maxY(); y += maxTextureSize.height()) { 379 382 IntRect tileRect(IntPoint(x, y), maxTextureSize); 380 383 tileRect.intersect(rect); 384 if (!tileRect.intersects(adjustedClipBounds)) 385 continue; 386 381 387 paintWithIntermediateSurface(options, tileRect); 382 388 }
Note: See TracChangeset
for help on using the changeset viewer.