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

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

Issue 1470123002: Split ClipTransformRecorder into {Clip,Transform}Recorder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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
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_CONTEXT_H_ 5 #ifndef UI_COMPOSITOR_PAINT_CONTEXT_H_
6 #define UI_COMPOSITOR_PAINT_CONTEXT_H_ 6 #define UI_COMPOSITOR_PAINT_CONTEXT_H_
7 7
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "ui/compositor/compositor_export.h" 10 #include "ui/compositor/compositor_export.h"
11 #include "ui/gfx/geometry/rect.h" 11 #include "ui/gfx/geometry/rect.h"
12 12
13 namespace cc { 13 namespace cc {
14 class DisplayItemList; 14 class DisplayItemList;
15 } 15 }
16 16
17 namespace gfx { 17 namespace gfx {
18 class Canvas; 18 class Canvas;
19 } 19 }
20 20
21 class SkPictureRecorder; 21 class SkPictureRecorder;
22 22
23 namespace ui { 23 namespace ui {
24 class ClipTransformRecorder; 24 class ClipRecorder;
danakj 2015/11/23 23:20:30 forward declare TransformRecorder too
wkorman 2015/11/23 23:38:08 Done.
25 class CompositingRecorder; 25 class CompositingRecorder;
26 class PaintRecorder; 26 class PaintRecorder;
27 27
28 class COMPOSITOR_EXPORT PaintContext { 28 class COMPOSITOR_EXPORT PaintContext {
29 public: 29 public:
30 // Construct a PaintContext that may only re-paint the area in the 30 // Construct a PaintContext that may only re-paint the area in the
31 // |invalidation|. 31 // |invalidation|.
32 PaintContext(cc::DisplayItemList* list, 32 PaintContext(cc::DisplayItemList* list,
33 float device_scale_factor, 33 float device_scale_factor,
34 const gfx::Rect& invalidation); 34 const gfx::Rect& invalidation);
(...skipping 29 matching lines...) Expand all
64 void* RootVisited() const { return root_visited_; } 64 void* RootVisited() const { return root_visited_; }
65 const gfx::Vector2d& PaintOffset() const { return offset_; } 65 const gfx::Vector2d& PaintOffset() const { return offset_; }
66 #endif 66 #endif
67 67
68 const gfx::Rect& InvalidationForTesting() const { return invalidation_; } 68 const gfx::Rect& InvalidationForTesting() const { return invalidation_; }
69 69
70 private: 70 private:
71 // The Recorder classes need access to the internal canvas and friends, but we 71 // The Recorder classes need access to the internal canvas and friends, but we
72 // don't want to expose them on this class so that people must go through the 72 // don't want to expose them on this class so that people must go through the
73 // recorders to access them. 73 // recorders to access them.
74 friend class ClipTransformRecorder; 74 friend class ClipRecorder;
75 friend class CompositingRecorder; 75 friend class CompositingRecorder;
76 friend class PaintRecorder; 76 friend class PaintRecorder;
77 friend class TransformRecorder;
77 // The Cache class also needs to access the DisplayItemList to append its 78 // The Cache class also needs to access the DisplayItemList to append its
78 // cache contents. 79 // cache contents.
79 friend class PaintCache; 80 friend class PaintCache;
80 81
81 cc::DisplayItemList* list_; 82 cc::DisplayItemList* list_;
82 scoped_ptr<SkPictureRecorder> owned_recorder_; 83 scoped_ptr<SkPictureRecorder> owned_recorder_;
83 // A pointer to the |owned_recorder_| in this PaintContext, or in another one 84 // A pointer to the |owned_recorder_| in this PaintContext, or in another one
84 // which this was copied from. We expect a copied-from PaintContext to outlive 85 // which this was copied from. We expect a copied-from PaintContext to outlive
85 // copies made from it. 86 // copies made from it.
86 SkPictureRecorder* recorder_; 87 SkPictureRecorder* recorder_;
(...skipping 15 matching lines...) Expand all
102 // recorder is active. 103 // recorder is active.
103 mutable bool inside_paint_recorder_; 104 mutable bool inside_paint_recorder_;
104 #endif 105 #endif
105 106
106 DISALLOW_COPY_AND_ASSIGN(PaintContext); 107 DISALLOW_COPY_AND_ASSIGN(PaintContext);
107 }; 108 };
108 109
109 } // namespace ui 110 } // namespace ui
110 111
111 #endif // UI_COMPOSITOR_PAINT_CONTEXT_H_ 112 #endif // UI_COMPOSITOR_PAINT_CONTEXT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698