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

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

Issue 2877483003: Implements core logic for Pixel Canvas (Closed)
Patch Set: Sync with ToT Created 3 years, 4 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/paint_context.cc ('k') | ui/compositor/paint_recorder.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 2015 The Chromium Authors. All rights reserved. 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 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_COMPOSITOR_PAINT_RECORDER_H_ 5 #ifndef UI_COMPOSITOR_PAINT_RECORDER_H_
6 #define UI_COMPOSITOR_PAINT_RECORDER_H_ 6 #define UI_COMPOSITOR_PAINT_RECORDER_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 14 matching lines...) Expand all
25 // A class to hide the complexity behind setting up a recording into a 25 // A class to hide the complexity behind setting up a recording into a
26 // DisplayItem. This is meant to be short-lived within the scope of recording 26 // DisplayItem. This is meant to be short-lived within the scope of recording
27 // taking place, the DisplayItem should be removed from the PaintRecorder once 27 // taking place, the DisplayItem should be removed from the PaintRecorder once
28 // recording is complete and can be cached. 28 // recording is complete and can be cached.
29 class COMPOSITOR_EXPORT PaintRecorder { 29 class COMPOSITOR_EXPORT PaintRecorder {
30 public: 30 public:
31 // The |cache| is owned by the caller and must be kept alive while 31 // The |cache| is owned by the caller and must be kept alive while
32 // PaintRecorder is in use. Canvas is bounded by |recording_size|. 32 // PaintRecorder is in use. Canvas is bounded by |recording_size|.
33 PaintRecorder(const PaintContext& context, 33 PaintRecorder(const PaintContext& context,
34 const gfx::Size& recording_size, 34 const gfx::Size& recording_size,
35 float recording_scale_x,
36 float recording_scale_y,
35 PaintCache* cache); 37 PaintCache* cache);
36 PaintRecorder(const PaintContext& context, const gfx::Size& recording_size); 38 PaintRecorder(const PaintContext& context, const gfx::Size& recording_size);
37 ~PaintRecorder(); 39 ~PaintRecorder();
38 40
39 // Gets a gfx::Canvas for painting into. 41 // Gets a gfx::Canvas for painting into.
40 gfx::Canvas* canvas() { return &canvas_; } 42 gfx::Canvas* canvas() { return &canvas_; }
41 43
42 private: 44 private:
43 const PaintContext& context_; 45 const PaintContext& context_;
44 scoped_refptr<cc::DisplayItemList> local_list_; 46 scoped_refptr<cc::DisplayItemList> local_list_;
45 cc::RecordPaintCanvas record_canvas_; 47 cc::RecordPaintCanvas record_canvas_;
46 gfx::Canvas canvas_; 48 gfx::Canvas canvas_;
47 PaintCache* cache_; 49 PaintCache* cache_;
48 gfx::Size recording_size_; 50 gfx::Size recording_size_;
49 51
50 DISALLOW_COPY_AND_ASSIGN(PaintRecorder); 52 DISALLOW_COPY_AND_ASSIGN(PaintRecorder);
51 }; 53 };
52 54
53 } // namespace ui 55 } // namespace ui
54 56
55 #endif // UI_COMPOSITOR_PAINT_RECORDER_H_ 57 #endif // UI_COMPOSITOR_PAINT_RECORDER_H_
OLDNEW
« no previous file with comments | « ui/compositor/paint_context.cc ('k') | ui/compositor/paint_recorder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698