Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(243)

Unified Diff: cc/paint/record_paint_canvas.cc

Issue 2889653002: Remove cullRect() from PaintOpBuffer. (Closed)
Patch Set: movecullrect2 rebase-once-and-for-all Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/paint/record_paint_canvas.h ('k') | cc/test/fake_content_layer_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/paint/record_paint_canvas.cc
diff --git a/cc/paint/record_paint_canvas.cc b/cc/paint/record_paint_canvas.cc
index 258b571bf123871612d53fb3f0cdc73c6169af6f..a635474a372be797e26a60cc88cb0f56bb645577 100644
--- a/cc/paint/record_paint_canvas.cc
+++ b/cc/paint/record_paint_canvas.cc
@@ -15,7 +15,9 @@
namespace cc {
-RecordPaintCanvas::RecordPaintCanvas(PaintOpBuffer* buffer) : buffer_(buffer) {
+RecordPaintCanvas::RecordPaintCanvas(PaintOpBuffer* buffer,
+ const SkRect& bounds)
+ : buffer_(buffer), recording_bounds_(bounds) {
DCHECK(buffer_);
}
@@ -352,20 +354,18 @@ SkNoDrawCanvas* RecordPaintCanvas::GetCanvas() {
if (canvas_)
return &*canvas_;
- SkRect recording_bounds = buffer_->cullRect();
-
// Size the canvas to be large enough to contain the |recording_bounds|, which
// may not be positioned at th origin.
- SkIRect enclosing_rect = recording_bounds.roundOut();
+ SkIRect enclosing_rect = recording_bounds_.roundOut();
canvas_.emplace(enclosing_rect.right(), enclosing_rect.bottom());
// This is part of the "recording canvases have a size, but why" dance.
// By creating a canvas of size (right x bottom) and then clipping it,
// It makes getDeviceClipBounds return the original cull rect, which code
// in GraphicsContextCanvas on Mac expects. (Just creating an SkNoDrawCanvas
- // with the cull_rect makes a canvas of size (width x height) instead
+ // with the recording_bounds_ makes a canvas of size (width x height) instead
// which is incorrect. SkRecorder cheats with private resetForNextCanvas.
- canvas_->clipRect(recording_bounds, SkClipOp::kIntersect, false);
+ canvas_->clipRect(recording_bounds_, SkClipOp::kIntersect, false);
return &*canvas_;
}
« no previous file with comments | « cc/paint/record_paint_canvas.h ('k') | cc/test/fake_content_layer_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698