Index: cc/playback/display_item_list.cc |
diff --git a/cc/playback/display_item_list.cc b/cc/playback/display_item_list.cc |
index 02f745f78b53f16ce0aedd1abd0a29f503c3d1c2..0bfe45155d46d2d57544654c77fc1c4784937741 100644 |
--- a/cc/playback/display_item_list.cc |
+++ b/cc/playback/display_item_list.cc |
@@ -16,6 +16,7 @@ |
#include "cc/debug/picture_debug_util.h" |
#include "cc/debug/traced_display_item_list.h" |
#include "cc/debug/traced_value.h" |
+#include "cc/paint/paint_recorder.h" |
#include "cc/playback/clip_display_item.h" |
#include "cc/playback/clip_path_display_item.h" |
#include "cc/playback/compositing_display_item.h" |
@@ -25,9 +26,6 @@ |
#include "cc/playback/float_clip_display_item.h" |
#include "cc/playback/largest_display_item.h" |
#include "cc/playback/transform_display_item.h" |
-#include "third_party/skia/include/core/SkCanvas.h" |
-#include "third_party/skia/include/core/SkPictureRecorder.h" |
-#include "third_party/skia/include/utils/SkPictureUtils.h" |
#include "ui/gfx/geometry/rect.h" |
#include "ui/gfx/geometry/rect_conversions.h" |
#include "ui/gfx/skia_util.h" |
@@ -47,7 +45,7 @@ bool DisplayItemsTracingEnabled() { |
return tracing_enabled; |
} |
-bool GetCanvasClipBounds(SkCanvas* canvas, gfx::Rect* clip_bounds) { |
+bool GetCanvasClipBounds(PaintCanvas* canvas, gfx::Rect* clip_bounds) { |
SkRect canvas_clip_bounds; |
if (!canvas->getClipBounds(&canvas_clip_bounds)) |
return false; |
@@ -77,8 +75,8 @@ DisplayItemList::DisplayItemList(const DisplayItemListSettings& settings) |
DisplayItemList::~DisplayItemList() { |
} |
-void DisplayItemList::Raster(SkCanvas* canvas, |
- SkPicture::AbortCallback* callback, |
+void DisplayItemList::Raster(PaintCanvas* canvas, |
+ PaintRecord::AbortCallback* callback, |
const gfx::Rect& canvas_target_playback_rect, |
float contents_scale) const { |
canvas->save(); |
@@ -96,8 +94,8 @@ void DisplayItemList::Raster(SkCanvas* canvas, |
} |
DISABLE_CFI_PERF |
-void DisplayItemList::Raster(SkCanvas* canvas, |
- SkPicture::AbortCallback* callback) const { |
+void DisplayItemList::Raster(PaintCanvas* canvas, |
+ PaintRecord::AbortCallback* callback) const { |
gfx::Rect canvas_playback_rect; |
if (!GetCanvasClipBounds(canvas, &canvas_playback_rect)) |
return; |
@@ -151,8 +149,6 @@ size_t DisplayItemList::ApproximateMemoryUsage() const { |
size_t memory_usage = sizeof(*this); |
size_t external_memory_usage = 0; |
- // Warning: this double-counts SkPicture data if use_cached_picture is |
- // also true. |
for (const auto& item : inputs_.items) { |
size_t bytes = 0; |
switch (item.type()) { |
@@ -229,13 +225,14 @@ DisplayItemList::AsValue(bool include_items) const { |
state->SetValue("layer_rect", MathUtil::AsValue(rtree_.GetBounds())); |
state->EndDictionary(); // "params". |
- SkPictureRecorder recorder; |
+ PaintRecorder recorder; |
gfx::Rect bounds = rtree_.GetBounds(); |
- SkCanvas* canvas = recorder.beginRecording(bounds.width(), bounds.height()); |
+ PaintCanvas* 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); |
- sk_sp<SkPicture> picture = recorder.finishRecordingAsPicture(); |
+ sk_sp<PaintRecord> picture = recorder.finishRecordingAsPicture(); |
std::string b64_picture; |
PictureDebugUtil::SerializeAsBase64(picture.get(), &b64_picture); |
@@ -255,7 +252,7 @@ void DisplayItemList::EmitTraceSnapshot() const { |
} |
void DisplayItemList::GenerateDiscardableImagesMetadata() { |
- // This should be only called once, and only after CreateAndCacheSkPicture. |
+ // This should be only called once. |
DCHECK(image_map_.empty()); |
gfx::Rect bounds = rtree_.GetBounds(); |