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

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

Issue 2849953004: SV Test
Patch Set: Created 3 years, 7 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 12 matching lines...) Expand all
23 // A class to hide the complexity behind setting up a recording into a 23 // A class to hide the complexity behind setting up a recording into a
24 // DisplayItem. This is meant to be short-lived within the scope of recording 24 // DisplayItem. This is meant to be short-lived within the scope of recording
25 // taking place, the DisplayItem should be removed from the PaintRecorder once 25 // taking place, the DisplayItem should be removed from the PaintRecorder once
26 // recording is complete and can be cached. 26 // recording is complete and can be cached.
27 class COMPOSITOR_EXPORT PaintRecorder { 27 class COMPOSITOR_EXPORT PaintRecorder {
28 public: 28 public:
29 // The |cache| is owned by the caller and must be kept alive while 29 // The |cache| is owned by the caller and must be kept alive while
30 // PaintRecorder is in use. Canvas is bounded by |recording_size|. 30 // PaintRecorder is in use. Canvas is bounded by |recording_size|.
31 PaintRecorder(const PaintContext& context, 31 PaintRecorder(const PaintContext& context,
32 const gfx::Size& recording_size, 32 const gfx::Size& recording_size,
33 PaintCache* cache); 33 PaintCache* cache,
34 bool is_scaled = false);
35
36 PaintRecorder(const PaintContext& context,
37 const gfx::Size& recording_size,
38 PaintCache* cache,
39 float canvas_scale_x,
40 float canvas_scale_y,
41 bool is_scaled = false);
42
34 PaintRecorder(const PaintContext& context, const gfx::Size& recording_size); 43 PaintRecorder(const PaintContext& context, const gfx::Size& recording_size);
35 ~PaintRecorder(); 44 ~PaintRecorder();
36 45
37 // Gets a gfx::Canvas for painting into. 46 // Gets a gfx::Canvas for painting into.
38 gfx::Canvas* canvas() { return &canvas_; } 47 gfx::Canvas* canvas() { return &canvas_; }
39 48
40 private: 49 private:
41 const PaintContext& context_; 50 const PaintContext& context_;
42 gfx::Canvas canvas_; 51 gfx::Canvas canvas_;
43 PaintCache* cache_; 52 PaintCache* cache_;
44 gfx::Rect bounds_in_layer_; 53 gfx::Rect bounds_in_layer_;
45 54
46 DISALLOW_COPY_AND_ASSIGN(PaintRecorder); 55 DISALLOW_COPY_AND_ASSIGN(PaintRecorder);
47 }; 56 };
48 57
49 } // namespace ui 58 } // namespace ui
50 59
51 #endif // UI_COMPOSITOR_PAINT_RECORDER_H_ 60 #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