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

Unified Diff: cc/playback/display_item_list.cc

Issue 2523673004: [NOT FOR COMMIT] Fully replace SkCanvas uses.
Patch Set: Support Android build. Created 4 years 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/playback/display_item_list.h ('k') | cc/playback/display_item_list_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/playback/display_item_list.cc
diff --git a/cc/playback/display_item_list.cc b/cc/playback/display_item_list.cc
index 068cb00999b665bedd8d587cef4a66c2fe128a66..fff2f5c9c045d5acd32cf63672d197c22523d47e 100644
--- a/cc/playback/display_item_list.cc
+++ b/cc/playback/display_item_list.cc
@@ -44,7 +44,7 @@ bool DisplayItemsTracingEnabled() {
return tracing_enabled;
}
-bool GetCanvasClipBounds(SkCanvas* canvas, gfx::Rect* clip_bounds) {
+bool GetCanvasClipBounds(CdlCanvas* canvas, gfx::Rect* clip_bounds) {
SkRect canvas_clip_bounds;
if (!canvas->getClipBounds(&canvas_clip_bounds))
return false;
@@ -111,7 +111,7 @@ void DisplayItemList::ToProtobuf(proto::DisplayItemList* proto) {
}
}
-void DisplayItemList::Raster(SkCanvas* canvas,
+void DisplayItemList::Raster(CdlCanvas* canvas,
SkPicture::AbortCallback* callback,
const gfx::Rect& canvas_target_playback_rect,
float contents_scale) const {
@@ -130,7 +130,7 @@ void DisplayItemList::Raster(SkCanvas* canvas,
}
DISABLE_CFI_PERF
-void DisplayItemList::Raster(SkCanvas* canvas,
+void DisplayItemList::Raster(CdlCanvas* canvas,
SkPicture::AbortCallback* callback) const {
gfx::Rect canvas_playback_rect;
if (!GetCanvasClipBounds(canvas, &canvas_playback_rect))
@@ -231,10 +231,12 @@ DisplayItemList::AsValue(bool include_items) const {
SkPictureRecorder recorder;
gfx::Rect bounds = rtree_.GetBounds();
- SkCanvas* canvas = recorder.beginRecording(bounds.width(), bounds.height());
- canvas->translate(-bounds.x(), -bounds.y());
- canvas->clipRect(gfx::RectToSkRect(bounds));
- Raster(canvas, nullptr, gfx::Rect(), 1.f);
+ SkCanvas* sk_canvas =
+ recorder.beginRecording(bounds.width(), bounds.height());
+ CdlPassThroughCanvas canvas(sk_canvas);
+ canvas.translate(-bounds.x(), -bounds.y());
+ canvas.clipRect(gfx::RectToSkRect(bounds));
+ Raster(&canvas, nullptr, gfx::Rect(), 1.f);
sk_sp<SkPicture> picture = recorder.finishRecordingAsPicture();
std::string b64_picture;
« no previous file with comments | « cc/playback/display_item_list.h ('k') | cc/playback/display_item_list_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698