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

Side by Side Diff: ui/gfx/canvas.h

Issue 2764633002: cc/paint: Remove cc::PaintSurface. (Closed)
Patch Set: more stuff Created 3 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_GFX_CANVAS_H_ 5 #ifndef UI_GFX_CANVAS_H_
6 #define UI_GFX_CANVAS_H_ 6 #define UI_GFX_CANVAS_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/macros.h" 13 #include "base/macros.h"
14 #include "base/strings/string16.h" 14 #include "base/strings/string16.h"
15 #include "cc/paint/paint_canvas.h" 15 #include "cc/paint/paint_canvas.h"
16 #include "cc/paint/paint_flags.h" 16 #include "cc/paint/paint_flags.h"
17 #include "cc/paint/paint_surface.h"
18 #include "ui/gfx/image/image_skia.h" 17 #include "ui/gfx/image/image_skia.h"
19 #include "ui/gfx/native_widget_types.h" 18 #include "ui/gfx/native_widget_types.h"
20 #include "ui/gfx/text_constants.h" 19 #include "ui/gfx/text_constants.h"
21 20
22 namespace gfx { 21 namespace gfx {
23 22
24 class Rect; 23 class Rect;
25 class RectF; 24 class RectF;
26 class FontList; 25 class FontList;
27 class Point; 26 class Point;
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 bool filter, 495 bool filter,
497 const cc::PaintFlags& flags, 496 const cc::PaintFlags& flags,
498 bool remove_image_scale); 497 bool remove_image_scale);
499 498
500 // The device scale factor at which drawing on this canvas occurs. 499 // The device scale factor at which drawing on this canvas occurs.
501 // An additional scale can be applied via Canvas::Scale(). However, 500 // An additional scale can be applied via Canvas::Scale(). However,
502 // Canvas::Scale() does not affect |image_scale_|. 501 // Canvas::Scale() does not affect |image_scale_|.
503 float image_scale_; 502 float image_scale_;
504 503
505 // canvas_ is our active canvas object. Sometimes we are also the owner, 504 // canvas_ is our active canvas object. Sometimes we are also the owner,
506 // in which case surface_ will be set. Other times we are just 505 // in which case owned_canvas_ will be set. Other times we are just
507 // borrowing someone else's canvas, in which case canvas_ will point there 506 // borrowing someone else's canvas, in which case canvas_ will point there
508 // but surface_ will be null. 507 // but owned_canvas_ will be null.
509 sk_sp<cc::PaintSurface> surface_; 508 std::unique_ptr<cc::PaintCanvas> owned_canvas_;
510 cc::PaintCanvas* canvas_; 509 cc::PaintCanvas* canvas_;
511 510
512 DISALLOW_COPY_AND_ASSIGN(Canvas); 511 DISALLOW_COPY_AND_ASSIGN(Canvas);
513 }; 512 };
514 513
515 } // namespace gfx 514 } // namespace gfx
516 515
517 #endif // UI_GFX_CANVAS_H_ 516 #endif // UI_GFX_CANVAS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698