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

Side by Side Diff: ui/compositor/canvas_painter.h

Issue 1161933007: ui: Introduce CanvasPainter, remove PaintContext(gfx::Canvas*). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: canvaspainter: . Created 5 years, 6 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 | « ui/compositor/BUILD.gn ('k') | ui/compositor/canvas_painter.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef UI_COMPOSITOR_CANVAS_PAINTER_H_
6 #define UI_COMPOSITOR_CANVAS_PAINTER_H_
7
8 #include "base/memory/ref_counted.h"
9 #include "ui/compositor/compositor_export.h"
10 #include "ui/compositor/paint_context.h"
11 #include "ui/gfx/geometry/rect.h"
12
13 namespace cc {
14 class DisplayItemList;
15 }
16
17 namespace gfx {
18 class Canvas;
19 }
20
21 namespace ui {
22
23 // This class provides a simple helper for painting directly to a bitmap
24 // backed canvas (for painting use-cases other than compositing). After
25 // constructing an instance of a CanvasPainter, the context() can be used
26 // to do painting using the normal composited paint paths. When
27 // the painter is destroyed, any painting done with the context() will be
28 // rastered into the canvas.
29 class COMPOSITOR_EXPORT CanvasPainter {
30 public:
31 CanvasPainter(gfx::Canvas* canvas, float raster_scale_factor);
32 ~CanvasPainter();
33
34 const PaintContext& context() const { return context_; }
35
36 private:
37 gfx::Canvas* canvas_;
38 float raster_scale_factor_;
sky 2015/06/04 22:51:29 const
danakj 2015/06/04 22:56:19 Done.
39 gfx::Rect rect_;
sky 2015/06/04 22:51:29 const
danakj 2015/06/04 22:56:19 Done.
40 scoped_refptr<cc::DisplayItemList> list_;
41 PaintContext context_;
42
43 DISALLOW_COPY_AND_ASSIGN(CanvasPainter);
44 };
45
46 } // namespace ui
47
48 #endif // UI_COMPOSITOR_CANVAS_PAINTER_H_
OLDNEW
« no previous file with comments | « ui/compositor/BUILD.gn ('k') | ui/compositor/canvas_painter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698