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

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

Issue 2615493003: use SkSurface behind gfx::Canvas (Closed)
Patch Set: rebase Created 3 years, 11 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
« no previous file with comments | « no previous file | ui/gfx/canvas.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "skia/ext/platform_canvas.h" 15 #include "skia/ext/platform_canvas.h"
16 #include "third_party/skia/include/core/SkRefCnt.h" 16 #include "third_party/skia/include/core/SkCanvas.h"
17 #include "third_party/skia/include/core/SkSurface.h"
17 #include "ui/gfx/image/image_skia.h" 18 #include "ui/gfx/image/image_skia.h"
18 #include "ui/gfx/native_widget_types.h" 19 #include "ui/gfx/native_widget_types.h"
19 #include "ui/gfx/text_constants.h" 20 #include "ui/gfx/text_constants.h"
20
21 namespace gfx { 21 namespace gfx {
22 22
23 class Rect; 23 class Rect;
24 class RectF; 24 class RectF;
25 class FontList; 25 class FontList;
26 class Point; 26 class Point;
27 class PointF; 27 class PointF;
28 class Size; 28 class Size;
29 class Transform; 29 class Transform;
30 class Vector2d; 30 class Vector2d;
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 bool filter, 488 bool filter,
489 const SkPaint& paint, 489 const SkPaint& paint,
490 bool remove_image_scale); 490 bool remove_image_scale);
491 491
492 // The device scale factor at which drawing on this canvas occurs. 492 // The device scale factor at which drawing on this canvas occurs.
493 // An additional scale can be applied via Canvas::Scale(). However, 493 // An additional scale can be applied via Canvas::Scale(). However,
494 // Canvas::Scale() does not affect |image_scale_|. 494 // Canvas::Scale() does not affect |image_scale_|.
495 float image_scale_; 495 float image_scale_;
496 496
497 // canvas_ is our active canvas object. Sometimes we are also the owner, 497 // canvas_ is our active canvas object. Sometimes we are also the owner,
498 // in which case canvas_owner_ will be set. Other times we are just 498 // in which case surface_ will be set. Other times we are just
499 // borrowing someone else's canvas, in which case canvas_ will point there 499 // borrowing someone else's canvas, in which case canvas_ will point there
500 // but canvas_owner_ will be null. 500 // but surface_ will be null.
501 std::unique_ptr<SkCanvas> canvas_owner_; 501 sk_sp<SkSurface> surface_;
502 SkCanvas* canvas_; 502 SkCanvas* canvas_;
503 503
504 DISALLOW_COPY_AND_ASSIGN(Canvas); 504 DISALLOW_COPY_AND_ASSIGN(Canvas);
505 }; 505 };
506 506
507 } // namespace gfx 507 } // namespace gfx
508 508
509 #endif // UI_GFX_CANVAS_H_ 509 #endif // UI_GFX_CANVAS_H_
OLDNEW
« 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