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

Unified Diff: ui/gfx/canvas.h

Issue 1424983005: ui: Fix NinePatchPainter to work in physical pixels. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ninepatchscale: testreview Created 5 years, 2 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 | « no previous file | ui/gfx/canvas.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/canvas.h
diff --git a/ui/gfx/canvas.h b/ui/gfx/canvas.h
index 0c409447a8ac7e43e58842178ba425e20a9d14bd..8183dfae02102461c56144b43426a9af161e19a8 100644
--- a/ui/gfx/canvas.h
+++ b/ui/gfx/canvas.h
@@ -309,14 +309,11 @@ class GFX_EXPORT Canvas {
const SkPaint& paint);
// Same as the DrawImageInt functions above. Difference being this does not
- // do any scaling, i.e. it assumes that the source/destination/image, etc are
- // in pixels. It does translate the destination rectangle to ensure that the
- // image is displayed at the correct pixel coordinates.
- void DrawImageIntInPixel(const ImageSkia& image,
- int src_x,
- int src_y,
- int src_w,
- int src_h,
+ // do any scaling, i.e. it does not scale the output by the device scale
+ // factor (the internal image_scale_). It takes an ImageSkiaRep instead of
+ // an ImageSkia as the caller chooses the exact scale/pixel representation to
+ // use, which will not be scaled while drawing it into the canvas.
+ void DrawImageIntInPixel(const ImageSkiaRep& image_rep,
int dest_x,
int dest_y,
int dest_w,
@@ -416,7 +413,7 @@ class GFX_EXPORT Canvas {
// Helper for the DrawImageInt functions declared above. The |pixel|
// parameter if true indicates that the bounds and the image are to
// be assumed to be in pixels, i.e. no scaling needs to be performed.
- void DrawImageIntHelper(const ImageSkia& image,
+ void DrawImageIntHelper(const ImageSkiaRep& image_rep,
int src_x,
int src_y,
int src_w,
@@ -427,7 +424,6 @@ class GFX_EXPORT Canvas {
int dest_h,
bool filter,
const SkPaint& paint,
- float image_scale,
bool pixel);
// The device scale factor at which drawing on this canvas occurs.
« no previous file with comments | « no previous file | ui/gfx/canvas.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698