| 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 <unordered_map> | 8 #include <unordered_map> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 const DrawQuad& quad, | 99 const DrawQuad& quad, |
| 100 const gfx::Rect& render_pass_scissor, | 100 const gfx::Rect& render_pass_scissor, |
| 101 bool use_render_pass_scissor); | 101 bool use_render_pass_scissor); |
| 102 bool ShouldSkipQuad(const DrawQuad& quad, | 102 bool ShouldSkipQuad(const DrawQuad& quad, |
| 103 const gfx::Rect& render_pass_scissor); | 103 const gfx::Rect& render_pass_scissor); |
| 104 void SetScissorTestRectInDrawSpace(const DrawingFrame* frame, | 104 void SetScissorTestRectInDrawSpace(const DrawingFrame* frame, |
| 105 const gfx::Rect& draw_space_rect); | 105 const gfx::Rect& draw_space_rect); |
| 106 | 106 |
| 107 static gfx::Size RenderPassTextureSize(const RenderPass* render_pass); | 107 static gfx::Size RenderPassTextureSize(const RenderPass* render_pass); |
| 108 | 108 |
| 109 void FlushPolygons(std::deque<scoped_ptr<DrawPolygon>>* poly_list, | 109 void FlushPolygons(std::deque<std::unique_ptr<DrawPolygon>>* poly_list, |
| 110 DrawingFrame* frame, | 110 DrawingFrame* frame, |
| 111 const gfx::Rect& render_pass_scissor, | 111 const gfx::Rect& render_pass_scissor, |
| 112 bool use_render_pass_scissor); | 112 bool use_render_pass_scissor); |
| 113 void DrawRenderPassAndExecuteCopyRequests(DrawingFrame* frame, | 113 void DrawRenderPassAndExecuteCopyRequests(DrawingFrame* frame, |
| 114 RenderPass* render_pass); | 114 RenderPass* render_pass); |
| 115 void DrawRenderPass(DrawingFrame* frame, const RenderPass* render_pass); | 115 void DrawRenderPass(DrawingFrame* frame, const RenderPass* render_pass); |
| 116 bool UseRenderPass(DrawingFrame* frame, const RenderPass* render_pass); | 116 bool UseRenderPass(DrawingFrame* frame, const RenderPass* render_pass); |
| 117 | 117 |
| 118 virtual void BindFramebufferToOutputSurface(DrawingFrame* frame) = 0; | 118 virtual void BindFramebufferToOutputSurface(DrawingFrame* frame) = 0; |
| 119 virtual bool BindFramebufferToTexture(DrawingFrame* frame, | 119 virtual bool BindFramebufferToTexture(DrawingFrame* frame, |
| (...skipping 13 matching lines...) Expand all Loading... |
| 133 virtual void FinishDrawingFrame(DrawingFrame* frame) = 0; | 133 virtual void FinishDrawingFrame(DrawingFrame* frame) = 0; |
| 134 virtual void FinishDrawingQuadList(); | 134 virtual void FinishDrawingQuadList(); |
| 135 virtual bool FlippedFramebuffer(const DrawingFrame* frame) const = 0; | 135 virtual bool FlippedFramebuffer(const DrawingFrame* frame) const = 0; |
| 136 virtual void EnsureScissorTestEnabled() = 0; | 136 virtual void EnsureScissorTestEnabled() = 0; |
| 137 virtual void EnsureScissorTestDisabled() = 0; | 137 virtual void EnsureScissorTestDisabled() = 0; |
| 138 virtual void DiscardBackbuffer() {} | 138 virtual void DiscardBackbuffer() {} |
| 139 virtual void EnsureBackbuffer() {} | 139 virtual void EnsureBackbuffer() {} |
| 140 | 140 |
| 141 virtual void CopyCurrentRenderPassToBitmap( | 141 virtual void CopyCurrentRenderPassToBitmap( |
| 142 DrawingFrame* frame, | 142 DrawingFrame* frame, |
| 143 scoped_ptr<CopyOutputRequest> request) = 0; | 143 std::unique_ptr<CopyOutputRequest> request) = 0; |
| 144 | 144 |
| 145 // TODO(danakj): Just use a vector of pairs here? Hash map is way overkill. | 145 // TODO(danakj): Just use a vector of pairs here? Hash map is way overkill. |
| 146 std::unordered_map<RenderPassId, scoped_ptr<ScopedResource>, RenderPassIdHash> | 146 std::unordered_map<RenderPassId, |
| 147 std::unique_ptr<ScopedResource>, |
| 148 RenderPassIdHash> |
| 147 render_pass_textures_; | 149 render_pass_textures_; |
| 148 OutputSurface* output_surface_; | 150 OutputSurface* output_surface_; |
| 149 ResourceProvider* resource_provider_; | 151 ResourceProvider* resource_provider_; |
| 150 scoped_ptr<OverlayProcessor> overlay_processor_; | 152 std::unique_ptr<OverlayProcessor> overlay_processor_; |
| 151 | 153 |
| 152 // For use in coordinate conversion, this stores the output rect, viewport | 154 // For use in coordinate conversion, this stores the output rect, viewport |
| 153 // rect (= unflipped version of glViewport rect), the size of target | 155 // rect (= unflipped version of glViewport rect), the size of target |
| 154 // framebuffer, and the current window space viewport. During a draw, this | 156 // framebuffer, and the current window space viewport. During a draw, this |
| 155 // stores the values for the current render pass; in between draws, they | 157 // stores the values for the current render pass; in between draws, they |
| 156 // retain the values for the root render pass of the last draw. | 158 // retain the values for the root render pass of the last draw. |
| 157 gfx::Rect current_draw_rect_; | 159 gfx::Rect current_draw_rect_; |
| 158 gfx::Rect current_viewport_rect_; | 160 gfx::Rect current_viewport_rect_; |
| 159 gfx::Size current_surface_size_; | 161 gfx::Size current_surface_size_; |
| 160 gfx::Rect current_window_space_viewport_; | 162 gfx::Rect current_window_space_viewport_; |
| 161 | 163 |
| 162 private: | 164 private: |
| 163 gfx::Vector2d enlarge_pass_texture_amount_; | 165 gfx::Vector2d enlarge_pass_texture_amount_; |
| 164 | 166 |
| 165 DISALLOW_COPY_AND_ASSIGN(DirectRenderer); | 167 DISALLOW_COPY_AND_ASSIGN(DirectRenderer); |
| 166 }; | 168 }; |
| 167 | 169 |
| 168 } // namespace cc | 170 } // namespace cc |
| 169 | 171 |
| 170 #endif // CC_OUTPUT_DIRECT_RENDERER_H_ | 172 #endif // CC_OUTPUT_DIRECT_RENDERER_H_ |
| OLD | NEW |