OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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_OUTPUT_DIRECT_RENDERER_H_ | 5 #ifndef CC_OUTPUT_DIRECT_RENDERER_H_ |
6 #define CC_OUTPUT_DIRECT_RENDERER_H_ | 6 #define CC_OUTPUT_DIRECT_RENDERER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/containers/scoped_ptr_hash_map.h" | 10 #include "base/containers/scoped_ptr_hash_map.h" |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 virtual bool FlippedFramebuffer(const DrawingFrame* frame) const = 0; | 132 virtual bool FlippedFramebuffer(const DrawingFrame* frame) const = 0; |
133 virtual void EnsureScissorTestEnabled() = 0; | 133 virtual void EnsureScissorTestEnabled() = 0; |
134 virtual void EnsureScissorTestDisabled() = 0; | 134 virtual void EnsureScissorTestDisabled() = 0; |
135 virtual void DiscardBackbuffer() {} | 135 virtual void DiscardBackbuffer() {} |
136 virtual void EnsureBackbuffer() {} | 136 virtual void EnsureBackbuffer() {} |
137 | 137 |
138 virtual void CopyCurrentRenderPassToBitmap( | 138 virtual void CopyCurrentRenderPassToBitmap( |
139 DrawingFrame* frame, | 139 DrawingFrame* frame, |
140 scoped_ptr<CopyOutputRequest> request) = 0; | 140 scoped_ptr<CopyOutputRequest> request) = 0; |
141 | 141 |
| 142 // TODO(danakj): Just use a vector of pairs here? Hash map is way overkill. |
142 base::ScopedPtrHashMap<RenderPassId, scoped_ptr<ScopedResource>> | 143 base::ScopedPtrHashMap<RenderPassId, scoped_ptr<ScopedResource>> |
143 render_pass_textures_; | 144 render_pass_textures_; |
144 OutputSurface* output_surface_; | 145 OutputSurface* output_surface_; |
145 ResourceProvider* resource_provider_; | 146 ResourceProvider* resource_provider_; |
146 scoped_ptr<OverlayProcessor> overlay_processor_; | 147 scoped_ptr<OverlayProcessor> overlay_processor_; |
147 | 148 |
148 // For use in coordinate conversion, this stores the output rect, viewport | 149 // For use in coordinate conversion, this stores the output rect, viewport |
149 // rect (= unflipped version of glViewport rect), the size of target | 150 // rect (= unflipped version of glViewport rect), the size of target |
150 // framebuffer, and the current window space viewport. During a draw, this | 151 // framebuffer, and the current window space viewport. During a draw, this |
151 // stores the values for the current render pass; in between draws, they | 152 // stores the values for the current render pass; in between draws, they |
152 // retain the values for the root render pass of the last draw. | 153 // retain the values for the root render pass of the last draw. |
153 gfx::Rect current_draw_rect_; | 154 gfx::Rect current_draw_rect_; |
154 gfx::Rect current_viewport_rect_; | 155 gfx::Rect current_viewport_rect_; |
155 gfx::Size current_surface_size_; | 156 gfx::Size current_surface_size_; |
156 gfx::Rect current_window_space_viewport_; | 157 gfx::Rect current_window_space_viewport_; |
157 | 158 |
158 private: | 159 private: |
159 gfx::Vector2d enlarge_pass_texture_amount_; | 160 gfx::Vector2d enlarge_pass_texture_amount_; |
160 | 161 |
161 DISALLOW_COPY_AND_ASSIGN(DirectRenderer); | 162 DISALLOW_COPY_AND_ASSIGN(DirectRenderer); |
162 }; | 163 }; |
163 | 164 |
164 } // namespace cc | 165 } // namespace cc |
165 | 166 |
166 #endif // CC_OUTPUT_DIRECT_RENDERER_H_ | 167 #endif // CC_OUTPUT_DIRECT_RENDERER_H_ |
OLD | NEW |