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

Unified Diff: cc/resources/drawing_display_item.cc

Issue 951673002: Revert "Pull chromium at 2c3ffb2355a27c32f45e508ef861416b820c823b" (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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/resources/drawing_display_item.h ('k') | cc/resources/gpu_rasterizer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/drawing_display_item.cc
diff --git a/cc/resources/drawing_display_item.cc b/cc/resources/drawing_display_item.cc
index 6dffad9aa8595641f085eafa7403ee0c37e8f2b8..1ef149fa0177ef0c781c9ae0de711fbd8a8f1cfb 100644
--- a/cc/resources/drawing_display_item.cc
+++ b/cc/resources/drawing_display_item.cc
@@ -18,8 +18,9 @@
namespace cc {
-DrawingDisplayItem::DrawingDisplayItem(skia::RefPtr<SkPicture> picture)
- : picture_(picture) {
+DrawingDisplayItem::DrawingDisplayItem(skia::RefPtr<SkPicture> picture,
+ gfx::PointF location)
+ : picture_(picture), location_(location) {
}
DrawingDisplayItem::~DrawingDisplayItem() {
@@ -28,6 +29,7 @@ DrawingDisplayItem::~DrawingDisplayItem() {
void DrawingDisplayItem::Raster(SkCanvas* canvas,
SkDrawPictureCallback* callback) const {
canvas->save();
+ canvas->translate(location_.x(), location_.y());
if (callback)
picture_->playback(canvas, callback);
else
@@ -37,6 +39,7 @@ void DrawingDisplayItem::Raster(SkCanvas* canvas,
void DrawingDisplayItem::RasterForTracing(SkCanvas* canvas) const {
canvas->save();
+ canvas->translate(location_.x(), location_.y());
// The picture debugger in about:tracing doesn't drill down into |drawPicture|
// operations. Calling |playback()| rather than |drawPicture()| causes the
// skia operations in |picture_| to appear individually in the picture
@@ -51,7 +54,7 @@ bool DrawingDisplayItem::IsSuitableForGpuRasterization() const {
}
int DrawingDisplayItem::ApproximateOpCount() const {
- return picture_->approximateOpCount();
+ return picture_->approximateOpCount() + sizeof(gfx::PointF);
}
size_t DrawingDisplayItem::PictureMemoryUsage() const {
@@ -63,11 +66,9 @@ void DrawingDisplayItem::AsValueInto(
base::trace_event::TracedValue* array) const {
array->BeginDictionary();
array->SetString("name", "DrawingDisplayItem");
- array->SetString(
- "cullRect",
- base::StringPrintf("[%f,%f,%f,%f]", picture_->cullRect().x(),
- picture_->cullRect().y(), picture_->cullRect().width(),
- picture_->cullRect().height()));
+ array->SetString("location",
+ base::StringPrintf("[%f,%f]", picture_->cullRect().x(),
+ picture_->cullRect().y()));
std::string b64_picture;
PictureDebugUtil::SerializeAsBase64(picture_.get(), &b64_picture);
array->SetString("skp64", b64_picture);
« no previous file with comments | « cc/resources/drawing_display_item.h ('k') | cc/resources/gpu_rasterizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698