| 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 <memory> | 8 #include <memory> |
| 9 #include <unordered_map> | 9 #include <unordered_map> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 OutputSurface* const output_surface_; | 181 OutputSurface* const output_surface_; |
| 182 ResourceProvider* const resource_provider_; | 182 ResourceProvider* const resource_provider_; |
| 183 // This can be replaced by test implementations. | 183 // This can be replaced by test implementations. |
| 184 std::unique_ptr<OverlayProcessor> overlay_processor_; | 184 std::unique_ptr<OverlayProcessor> overlay_processor_; |
| 185 | 185 |
| 186 // Whether it's valid to SwapBuffers with an empty rect. Trivially true when | 186 // Whether it's valid to SwapBuffers with an empty rect. Trivially true when |
| 187 // using partial swap. | 187 // using partial swap. |
| 188 bool allow_empty_swap_; | 188 bool allow_empty_swap_; |
| 189 // Whether partial swap can be used. | 189 // Whether partial swap can be used. |
| 190 bool use_partial_swap_; | 190 bool use_partial_swap_; |
| 191 // Whether overdraw feedback is enabled and can be used. |
| 192 bool overdraw_feedback_ = false; |
| 191 | 193 |
| 192 // TODO(danakj): Just use a vector of pairs here? Hash map is way overkill. | 194 // TODO(danakj): Just use a vector of pairs here? Hash map is way overkill. |
| 193 std::unordered_map<int, std::unique_ptr<ScopedResource>> | 195 std::unordered_map<int, std::unique_ptr<ScopedResource>> |
| 194 render_pass_textures_; | 196 render_pass_textures_; |
| 195 std::unordered_map<int, TileDrawQuad> render_pass_bypass_quads_; | 197 std::unordered_map<int, TileDrawQuad> render_pass_bypass_quads_; |
| 196 | 198 |
| 197 RenderPassFilterList render_pass_filters_; | 199 RenderPassFilterList render_pass_filters_; |
| 198 RenderPassFilterList render_pass_background_filters_; | 200 RenderPassFilterList render_pass_background_filters_; |
| 199 | 201 |
| 200 bool visible_ = false; | 202 bool visible_ = false; |
| 201 | 203 |
| 202 // For use in coordinate conversion, this stores the output rect, viewport | 204 // For use in coordinate conversion, this stores the output rect, viewport |
| 203 // rect (= unflipped version of glViewport rect), the size of target | 205 // rect (= unflipped version of glViewport rect), the size of target |
| 204 // framebuffer, and the current window space viewport. During a draw, this | 206 // framebuffer, and the current window space viewport. During a draw, this |
| 205 // stores the values for the current render pass; in between draws, they | 207 // stores the values for the current render pass; in between draws, they |
| 206 // retain the values for the root render pass of the last draw. | 208 // retain the values for the root render pass of the last draw. |
| 207 gfx::Rect current_draw_rect_; | 209 gfx::Rect current_draw_rect_; |
| 208 gfx::Rect current_viewport_rect_; | 210 gfx::Rect current_viewport_rect_; |
| 209 gfx::Size current_surface_size_; | 211 gfx::Size current_surface_size_; |
| 210 gfx::Rect current_window_space_viewport_; | 212 gfx::Rect current_window_space_viewport_; |
| 211 | 213 |
| 212 private: | 214 private: |
| 213 bool initialized_ = false; | 215 bool initialized_ = false; |
| 216 #if DCHECK_IS_ON() |
| 217 bool overdraw_feedback_support_missing_logged_once_ = false; |
| 218 #endif |
| 214 gfx::Size enlarge_pass_texture_amount_; | 219 gfx::Size enlarge_pass_texture_amount_; |
| 215 | 220 |
| 216 // Cached values given to Reshape(). | 221 // Cached values given to Reshape(). |
| 217 gfx::Size reshape_surface_size_; | 222 gfx::Size reshape_surface_size_; |
| 218 float reshape_device_scale_factor_ = 0.f; | 223 float reshape_device_scale_factor_ = 0.f; |
| 219 gfx::ColorSpace reshape_device_color_space_; | 224 gfx::ColorSpace reshape_device_color_space_; |
| 220 bool reshape_has_alpha_ = false; | 225 bool reshape_has_alpha_ = false; |
| 226 bool reshape_use_stencil_ = false; |
| 221 | 227 |
| 222 DISALLOW_COPY_AND_ASSIGN(DirectRenderer); | 228 DISALLOW_COPY_AND_ASSIGN(DirectRenderer); |
| 223 }; | 229 }; |
| 224 | 230 |
| 225 } // namespace cc | 231 } // namespace cc |
| 226 | 232 |
| 227 #endif // CC_OUTPUT_DIRECT_RENDERER_H_ | 233 #endif // CC_OUTPUT_DIRECT_RENDERER_H_ |
| OLD | NEW |