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

Unified Diff: ui/gfx/canvas_paint_win.h

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/canvas_paint_gtk.cc ('k') | ui/gfx/image/image_skia_operations.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/canvas_paint_win.h
===================================================================
--- ui/gfx/canvas_paint_win.h (revision 167659)
+++ ui/gfx/canvas_paint_win.h (working copy)
@@ -8,6 +8,7 @@
#include "skia/ext/platform_canvas.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/canvas_paint.h"
+#include "ui/gfx/size.h"
namespace gfx {
@@ -102,18 +103,17 @@
}
void init(bool opaque) {
- skia::PlatformCanvas* canvas = platform_canvas();
// FIXME(brettw) for ClearType, we probably want to expand the bounds of
// painting by one pixel so that the boundaries will be correct (ClearType
// text can depend on the adjacent pixel). Then we would paint just the
// inset pixels to the screen.
const int width = ps_.rcPaint.right - ps_.rcPaint.left;
const int height = ps_.rcPaint.bottom - ps_.rcPaint.top;
- if (!canvas->initialize(width, height, opaque, NULL)) {
- // Cause a deliberate crash;
- __debugbreak();
- _exit(1);
- }
+
+ RecreateBackingCanvas(gfx::Size(width, height), ui::SCALE_FACTOR_100P,
+ opaque);
+ skia::PlatformCanvas* canvas = platform_canvas();
+
canvas->clear(SkColorSetARGB(0, 0, 0, 0));
// This will bring the canvas into the screen coordinate system for the
« no previous file with comments | « ui/gfx/canvas_paint_gtk.cc ('k') | ui/gfx/image/image_skia_operations.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698