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

Unified Diff: ui/gfx/canvas.cc

Issue 11138024: Simplify platform_canvas.h by recognizing that PlatformCanvas does not actually extend (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 1 month 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 | « ui/gfx/blit_unittest.cc ('k') | ui/gfx/canvas_paint_gtk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/canvas.cc
===================================================================
--- ui/gfx/canvas.cc (revision 167659)
+++ ui/gfx/canvas.cc (working copy)
@@ -31,9 +31,9 @@
canvas_(NULL) {
gfx::Size pixel_size = gfx::ToFlooredSize(
gfx::ScaleSize(size, ui::GetScaleFactorScale(scale_factor)));
- owned_canvas_.reset(new skia::PlatformCanvas(pixel_size.width(),
- pixel_size.height(),
- is_opaque));
+ owned_canvas_.reset(skia::CreatePlatformCanvas(pixel_size.width(),
+ pixel_size.height(),
+ is_opaque));
canvas_ = owned_canvas_.get();
#if defined(OS_WIN) || defined(OS_MACOSX)
// skia::PlatformCanvas instances are initialized to 0 by Cairo on Linux, but
@@ -48,7 +48,7 @@
Canvas::Canvas(const gfx::ImageSkiaRep& image_rep, bool is_opaque)
: scale_factor_(image_rep.scale_factor()),
- owned_canvas_(new skia::PlatformCanvas(image_rep.pixel_width(),
+ owned_canvas_(skia::CreatePlatformCanvas(image_rep.pixel_width(),
image_rep.pixel_height(),
is_opaque)),
canvas_(owned_canvas_.get()) {
@@ -59,7 +59,7 @@
Canvas::Canvas()
: scale_factor_(ui::SCALE_FACTOR_100P),
- owned_canvas_(new skia::PlatformCanvas()),
+ owned_canvas_(skia::CreatePlatformCanvas(0, 0, false)),
canvas_(owned_canvas_.get()) {
}
@@ -78,9 +78,9 @@
scale_factor_ = scale_factor;
gfx::Size pixel_size = gfx::ToFlooredSize(
gfx::ScaleSize(size, ui::GetScaleFactorScale(scale_factor)));
- owned_canvas_.reset(new skia::PlatformCanvas(pixel_size.width(),
- pixel_size.height(),
- is_opaque));
+ owned_canvas_.reset(skia::CreatePlatformCanvas(pixel_size.width(),
+ pixel_size.height(),
+ is_opaque));
canvas_ = owned_canvas_.get();
SkScalar scale = SkFloatToScalar(ui::GetScaleFactorScale(scale_factor_));
canvas_->scale(scale, scale);
« no previous file with comments | « ui/gfx/blit_unittest.cc ('k') | ui/gfx/canvas_paint_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698