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

Unified Diff: cc/picture.cc

Issue 11678003: cc: Fix low-res impl-side painting artifacts (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: \okayguy{0.0625*f*} Created 7 years, 11 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/picture.h ('k') | cc/picture_layer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/picture.cc
diff --git a/cc/picture.cc b/cc/picture.cc
index 378c20ea0bde935917c6543b3d01392a70c2ebac..b0e36e89c17b186b911bbee97184c496771b5a5a 100644
--- a/cc/picture.cc
+++ b/cc/picture.cc
@@ -10,6 +10,7 @@
#include "third_party/skia/include/core/SkData.h"
#include "third_party/skia/include/utils/SkPictureUtils.h"
#include "ui/gfx/rect_conversions.h"
+#include "ui/gfx/skia_util.h"
namespace {
// URI label for a lazily decoded SkPixelRef.
@@ -88,10 +89,16 @@ void Picture::Record(ContentLayerClient* painter,
opaque_rect_ = gfx::ToEnclosedRect(opaque_layer_rect);
}
-void Picture::Raster(SkCanvas* canvas) {
+void Picture::Raster(
+ SkCanvas* canvas,
+ gfx::Rect content_rect,
+ float contents_scale) {
TRACE_EVENT0("cc", "Picture::Raster");
DCHECK(picture_);
+
canvas->save();
+ canvas->clipRect(gfx::RectToSkRect(content_rect));
+ canvas->scale(contents_scale, contents_scale);
canvas->translate(layer_rect_.x(), layer_rect_.y());
canvas->drawPicture(*picture_);
canvas->restore();
« no previous file with comments | « cc/picture.h ('k') | cc/picture_layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698