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

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

Issue 2615493003: use SkSurface behind gfx::Canvas (Closed)
Patch Set: anon namespace 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') | ui/gfx/canvas.cc » ('J')
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/shadow_value.h" 20 #include "ui/gfx/shadow_value.h"
20 #include "ui/gfx/text_constants.h" 21 #include "ui/gfx/text_constants.h"
21
22 namespace gfx { 22 namespace gfx {
23 23
24 class Rect; 24 class Rect;
25 class RectF; 25 class RectF;
26 class FontList; 26 class FontList;
27 class Point; 27 class Point;
28 class PointF; 28 class PointF;
29 class Size; 29 class Size;
30 class Transform; 30 class Transform;
31 31
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
499 bool filter, 499 bool filter,
500 const SkPaint& paint, 500 const SkPaint& paint,
501 bool remove_image_scale); 501 bool remove_image_scale);
502 502
503 // The device scale factor at which drawing on this canvas occurs. 503 // The device scale factor at which drawing on this canvas occurs.
504 // An additional scale can be applied via Canvas::Scale(). However, 504 // An additional scale can be applied via Canvas::Scale(). However,
505 // Canvas::Scale() does not affect |image_scale_|. 505 // Canvas::Scale() does not affect |image_scale_|.
506 float image_scale_; 506 float image_scale_;
507 507
508 // canvas_ is our active canvas object. Sometimes we are also the owner, 508 // canvas_ is our active canvas object. Sometimes we are also the owner,
509 // in which case canvas_owner_ will be set. Other times we are just 509 // in which case surface_ will be set. Other times we are just
510 // borrowing someone else's canvas, in which case canvas_ will point there 510 // borrowing someone else's canvas, in which case canvas_ will point there
511 // but canvas_owner_ will be null. 511 // but surface_ will be null.
512 std::unique_ptr<SkCanvas> canvas_owner_; 512 sk_sp<SkSurface> surface_;
513 SkCanvas* canvas_; 513 SkCanvas* canvas_;
514 514
515 DISALLOW_COPY_AND_ASSIGN(Canvas); 515 DISALLOW_COPY_AND_ASSIGN(Canvas);
516 }; 516 };
517 517
518 } // namespace gfx 518 } // namespace gfx
519 519
520 #endif // UI_GFX_CANVAS_H_ 520 #endif // UI_GFX_CANVAS_H_
OLDNEW
« no previous file with comments | « no previous file | ui/gfx/canvas.cc » ('j') | ui/gfx/canvas.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698