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" |
11 #include "cc/base/cc_export.h" | 11 #include "cc/base/cc_export.h" |
12 #include "cc/output/renderer.h" | 12 #include "cc/output/renderer.h" |
13 #include "cc/resources/resource_provider.h" | 13 #include "cc/resources/resource_provider.h" |
14 #include "cc/resources/scoped_resource.h" | 14 #include "cc/resources/scoped_resource.h" |
| 15 #include "cc/resources/task_graph_runner.h" |
15 | 16 |
16 namespace cc { | 17 namespace cc { |
17 | 18 |
18 class ResourceProvider; | 19 class ResourceProvider; |
19 | 20 |
20 // This is the base class for code shared between the GL and software | 21 // This is the base class for code shared between the GL and software |
21 // renderer implementations. "Direct" refers to the fact that it does not | 22 // renderer implementations. "Direct" refers to the fact that it does not |
22 // delegate rendering to another compositor. | 23 // delegate rendering to another compositor. |
23 class CC_EXPORT DirectRenderer : public Renderer { | 24 class CC_EXPORT DirectRenderer : public Renderer { |
24 public: | 25 public: |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 void SetScissorTestRectInDrawSpace(const DrawingFrame* frame, | 90 void SetScissorTestRectInDrawSpace(const DrawingFrame* frame, |
90 const gfx::RectF& draw_space_rect); | 91 const gfx::RectF& draw_space_rect); |
91 | 92 |
92 static gfx::Size RenderPassTextureSize(const RenderPass* render_pass); | 93 static gfx::Size RenderPassTextureSize(const RenderPass* render_pass); |
93 | 94 |
94 void DrawRenderPass(DrawingFrame* frame, | 95 void DrawRenderPass(DrawingFrame* frame, |
95 const RenderPass* render_pass, | 96 const RenderPass* render_pass, |
96 bool allow_partial_swap); | 97 bool allow_partial_swap); |
97 bool UseRenderPass(DrawingFrame* frame, const RenderPass* render_pass); | 98 bool UseRenderPass(DrawingFrame* frame, const RenderPass* render_pass); |
98 | 99 |
| 100 void RunOnDemandRasterTask(internal::Task* on_demand_raster_task); |
| 101 |
99 virtual void BindFramebufferToOutputSurface(DrawingFrame* frame) = 0; | 102 virtual void BindFramebufferToOutputSurface(DrawingFrame* frame) = 0; |
100 virtual bool BindFramebufferToTexture(DrawingFrame* frame, | 103 virtual bool BindFramebufferToTexture(DrawingFrame* frame, |
101 const ScopedResource* resource, | 104 const ScopedResource* resource, |
102 const gfx::Rect& target_rect) = 0; | 105 const gfx::Rect& target_rect) = 0; |
103 virtual void SetDrawViewport(const gfx::Rect& window_space_viewport) = 0; | 106 virtual void SetDrawViewport(const gfx::Rect& window_space_viewport) = 0; |
104 virtual void SetScissorTestRect(const gfx::Rect& scissor_rect) = 0; | 107 virtual void SetScissorTestRect(const gfx::Rect& scissor_rect) = 0; |
105 virtual void DiscardPixels(bool has_external_stencil_test, | 108 virtual void DiscardPixels(bool has_external_stencil_test, |
106 bool draw_rect_covers_full_surface) = 0; | 109 bool draw_rect_covers_full_surface) = 0; |
107 virtual void ClearFramebuffer(DrawingFrame* frame, | 110 virtual void ClearFramebuffer(DrawingFrame* frame, |
108 bool has_external_stencil_test) = 0; | 111 bool has_external_stencil_test) = 0; |
(...skipping 20 matching lines...) Expand all Loading... |
129 // framebuffer. During a draw, this stores the values for the current render | 132 // framebuffer. During a draw, this stores the values for the current render |
130 // pass; in between draws, they retain the values for the root render pass of | 133 // pass; in between draws, they retain the values for the root render pass of |
131 // the last draw. | 134 // the last draw. |
132 gfx::Rect current_draw_rect_; | 135 gfx::Rect current_draw_rect_; |
133 gfx::Rect current_viewport_rect_; | 136 gfx::Rect current_viewport_rect_; |
134 gfx::Size current_surface_size_; | 137 gfx::Size current_surface_size_; |
135 | 138 |
136 private: | 139 private: |
137 gfx::Vector2d enlarge_pass_texture_amount_; | 140 gfx::Vector2d enlarge_pass_texture_amount_; |
138 | 141 |
| 142 internal::NamespaceToken on_demand_task_namespace_; |
| 143 |
139 DISALLOW_COPY_AND_ASSIGN(DirectRenderer); | 144 DISALLOW_COPY_AND_ASSIGN(DirectRenderer); |
140 }; | 145 }; |
141 | 146 |
142 } // namespace cc | 147 } // namespace cc |
143 | 148 |
144 #endif // CC_OUTPUT_DIRECT_RENDERER_H_ | 149 #endif // CC_OUTPUT_DIRECT_RENDERER_H_ |
OLD | NEW |