| Index: third_party/WebKit/Source/platform/graphics/paint/DrawingRecorder.cpp
|
| diff --git a/third_party/WebKit/Source/platform/graphics/paint/DrawingRecorder.cpp b/third_party/WebKit/Source/platform/graphics/paint/DrawingRecorder.cpp
|
| index 4558b88dcaa34853c96606257d7d6a9362a8a1bc..d75455fe88b177c245b30a98c302bae04c29755f 100644
|
| --- a/third_party/WebKit/Source/platform/graphics/paint/DrawingRecorder.cpp
|
| +++ b/third_party/WebKit/Source/platform/graphics/paint/DrawingRecorder.cpp
|
| @@ -32,7 +32,7 @@ bool DrawingRecorder::useCachedDrawingIfPossible(GraphicsContext& context, const
|
| return true;
|
| }
|
|
|
| -DrawingRecorder::DrawingRecorder(GraphicsContext& context, const DisplayItemClient& displayItemClient, DisplayItem::Type displayItemType, const FloatRect& cullRect)
|
| +DrawingRecorder::DrawingRecorder(GraphicsContext& context, const DisplayItemClient& displayItemClient, DisplayItem::Type displayItemType, const FloatRect& floatCullRect)
|
| : m_context(context)
|
| , m_displayItemClient(displayItemClient)
|
| , m_displayItemType(displayItemType)
|
| @@ -55,6 +55,9 @@ DrawingRecorder::DrawingRecorder(GraphicsContext& context, const DisplayItemClie
|
| context.setInDrawingRecorder(true);
|
| #endif
|
|
|
| + // Use the enclosing int rect, since pixel-snapping may be applied to the bounds of the object during painting. Potentially expanding
|
| + // the cull rect by a pixel or two also does not affect correctness, and is very unlikely to matter for performance.
|
| + IntRect cullRect = enclosingIntRect(floatCullRect);
|
| context.beginRecording(cullRect);
|
|
|
| #if ENABLE(ASSERT)
|
| @@ -63,13 +66,12 @@ DrawingRecorder::DrawingRecorder(GraphicsContext& context, const DisplayItemClie
|
| // cull rect clipping is enabled, make this explicit. This allows us to identify potential
|
| // incorrect cull rects that might otherwise be masked due to Skia internal optimizations.
|
| context.save();
|
| - IntRect verificationClip = enclosingIntRect(cullRect);
|
| // Expand the verification clip by one pixel to account for Skia's SkCanvas::getClipBounds()
|
| // expansion, used in testing cull rects.
|
| // TODO(schenney) This is not the best place to do this. Ideally, we would expand by one pixel
|
| // in device (pixel) space, but to do that we would need to add the verification mode to Skia.
|
| - verificationClip.inflate(1);
|
| - context.clipRect(verificationClip, NotAntiAliased, SkRegion::kIntersect_Op);
|
| + cullRect.inflate(1);
|
| + context.clipRect(cullRect, NotAntiAliased, SkRegion::kIntersect_Op);
|
| }
|
| #endif
|
| }
|
|
|