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

Unified Diff: ui/gfx/canvas.h

Issue 1124223010: ui: Eliminate allocating gfx::Canvas on the heap for every view. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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
Index: ui/gfx/canvas.h
diff --git a/ui/gfx/canvas.h b/ui/gfx/canvas.h
index 88882fa2f765d1c754655df1e688588615e4124c..84a685cfb517f146fae5e67eae4bd50f30286b95 100644
--- a/ui/gfx/canvas.h
+++ b/ui/gfx/canvas.h
@@ -83,13 +83,12 @@ class GFX_EXPORT Canvas {
// |image_rep|, and draws the |image_rep| into it.
Canvas(const ImageSkiaRep& image_rep, bool is_opaque);
- virtual ~Canvas();
-
// Creates a Canvas backed by an |sk_canvas| with |image_scale_|.
// |sk_canvas| is assumed to be already scaled based on |image_scale|
// so no additional scaling is applied.
- static Canvas* CreateCanvasWithoutScaling(SkCanvas* sk_canvas,
- float image_scale);
+ Canvas(SkCanvas* sk_canvas, float image_scale);
+
+ virtual ~Canvas();
// Recreates the backing platform canvas with DIP |size| and |image_scale_|.
// If the canvas is not opaque, it is explicitly cleared.
@@ -413,8 +412,6 @@ class GFX_EXPORT Canvas {
float image_scale() const { return image_scale_; }
private:
- Canvas(SkCanvas* canvas, float image_scale);
-
// Test whether the provided rectangle intersects the current clip rect.
bool IntersectsClipRectInt(int x, int y, int w, int h);
bool IntersectsClipRect(const Rect& rect);

Powered by Google App Engine
This is Rietveld 408576698