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

Side by Side Diff: cc/render_pass.h

Issue 11418117: cc: Increment the ref count when assigning the SkImageFilter (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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 CC_RENDER_PASS_H_ 5 #ifndef CC_RENDER_PASS_H_
6 #define CC_RENDER_PASS_H_ 6 #define CC_RENDER_PASS_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "cc/cc_export.h" 9 #include "cc/cc_export.h"
10 #include "cc/draw_quad.h" 10 #include "cc/draw_quad.h"
11 #include "cc/hash_pair.h" 11 #include "cc/hash_pair.h"
12 #include "cc/scoped_ptr_hash_map.h" 12 #include "cc/scoped_ptr_hash_map.h"
13 #include "cc/scoped_ptr_vector.h" 13 #include "cc/scoped_ptr_vector.h"
14 #include "cc/shared_quad_state.h" 14 #include "cc/shared_quad_state.h"
15 #include "third_party/skia/include/core/SkColor.h" 15 #include "third_party/skia/include/core/SkColor.h"
16 #include "third_party/skia/include/core/SkImageFilter.h"
17 #include "third_party/skia/include/core/SkRefCnt.h"
16 #include "ui/gfx/rect_f.h" 18 #include "ui/gfx/rect_f.h"
17 #include <public/WebFilterOperations.h> 19 #include <public/WebFilterOperations.h>
18 #include <public/WebTransformationMatrix.h> 20 #include <public/WebTransformationMatrix.h>
19 #include <vector> 21 #include <vector>
20 22
21 class SkImageFilter;
22
23 namespace cc { 23 namespace cc {
24 24
25 // A list of DrawQuad objects, sorted internally in front-to-back order. 25 // A list of DrawQuad objects, sorted internally in front-to-back order.
26 class QuadList : public ScopedPtrVector<DrawQuad> { 26 class QuadList : public ScopedPtrVector<DrawQuad> {
27 public: 27 public:
28 typedef reverse_iterator backToFrontIterator; 28 typedef reverse_iterator backToFrontIterator;
29 typedef const_reverse_iterator constBackToFrontIterator; 29 typedef const_reverse_iterator constBackToFrontIterator;
30 30
31 inline backToFrontIterator backToFrontBegin() { return rbegin(); } 31 inline backToFrontIterator backToFrontBegin() { return rbegin(); }
32 inline backToFrontIterator backToFrontEnd() { return rend(); } 32 inline backToFrontIterator backToFrontEnd() { return rend(); }
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 gfx::RectF damage_rect, 68 gfx::RectF damage_rect,
69 const WebKit::WebTransformationMatrix& transform_to_root_target); 69 const WebKit::WebTransformationMatrix& transform_to_root_target);
70 70
71 void SetAll(Id id, 71 void SetAll(Id id,
72 gfx::Rect output_rect, 72 gfx::Rect output_rect,
73 gfx::RectF damage_rect, 73 gfx::RectF damage_rect,
74 const WebKit::WebTransformationMatrix& transform_to_root_target, 74 const WebKit::WebTransformationMatrix& transform_to_root_target,
75 bool has_transparent_background, 75 bool has_transparent_background,
76 bool has_occlusion_from_outside_target_surface, 76 bool has_occlusion_from_outside_target_surface,
77 const WebKit::WebFilterOperations& filters, 77 const WebKit::WebFilterOperations& filters,
78 SkImageFilter* filter, 78 const SkRefPtr<SkImageFilter>& filter,
79 const WebKit::WebFilterOperations& background_filters); 79 const WebKit::WebFilterOperations& background_filters);
80 80
81 // Uniquely identifies the render pass in the compositor's current frame. 81 // Uniquely identifies the render pass in the compositor's current frame.
82 Id id; 82 Id id;
83 83
84 // These are in the space of the render pass' physical pixels. 84 // These are in the space of the render pass' physical pixels.
85 gfx::Rect output_rect; 85 gfx::Rect output_rect;
86 gfx::RectF damage_rect; 86 gfx::RectF damage_rect;
87 87
88 // Transforms from the origin of the |output_rect| to the origin of the root 88 // Transforms from the origin of the |output_rect| to the origin of the root
89 // render pass' |output_rect|. 89 // render pass' |output_rect|.
90 WebKit::WebTransformationMatrix transform_to_root_target; 90 WebKit::WebTransformationMatrix transform_to_root_target;
91 91
92 // If false, the pixels in the render pass' texture are all opaque. 92 // If false, the pixels in the render pass' texture are all opaque.
93 bool has_transparent_background; 93 bool has_transparent_background;
94 94
95 // If true, then there may be pixels in the render pass' texture that are not 95 // If true, then there may be pixels in the render pass' texture that are not
96 // complete, since they are occluded. 96 // complete, since they are occluded.
97 bool has_occlusion_from_outside_target_surface; 97 bool has_occlusion_from_outside_target_surface;
98 98
99 // Deprecated post-processing filters, applied to the pixels in the render 99 // Deprecated post-processing filters, applied to the pixels in the render
100 // pass' texture. 100 // pass' texture.
101 WebKit::WebFilterOperations filters; 101 WebKit::WebFilterOperations filters;
102 // Post-processing filter applied to the pixels in the render pass' texture. 102 // Post-processing filter applied to the pixels in the render pass' texture.
103 SkImageFilter* filter; 103 SkRefPtr<SkImageFilter> filter;
104 104
105 // Post-processing filters, applied to the pixels showing through the 105 // Post-processing filters, applied to the pixels showing through the
106 // background of the render pass, from behind it. 106 // background of the render pass, from behind it.
107 WebKit::WebFilterOperations background_filters; 107 WebKit::WebFilterOperations background_filters;
108 108
109 QuadList quad_list; 109 QuadList quad_list;
110 SharedQuadStateList shared_quad_state_list; 110 SharedQuadStateList shared_quad_state_list;
111 111
112 protected: 112 protected:
113 RenderPass(); 113 RenderPass();
(...skipping 22 matching lines...) Expand all
136 #error define a hash function for your compiler 136 #error define a hash function for your compiler
137 #endif // COMPILER 137 #endif // COMPILER
138 } 138 }
139 139
140 namespace cc { 140 namespace cc {
141 typedef std::vector<RenderPass*> RenderPassList; 141 typedef std::vector<RenderPass*> RenderPassList;
142 typedef ScopedPtrHashMap<RenderPass::Id, RenderPass> RenderPassIdHashMap; 142 typedef ScopedPtrHashMap<RenderPass::Id, RenderPass> RenderPassIdHashMap;
143 } // namespace cc 143 } // namespace cc
144 144
145 #endif // CC_RENDER_PASS_H_ 145 #endif // CC_RENDER_PASS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698