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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 ResourceProvider* resource_provider); | 64 ResourceProvider* resource_provider); |
65 | 65 |
66 static gfx::RectF QuadVertexRect(); | 66 static gfx::RectF QuadVertexRect(); |
67 static void QuadRectTransform(gfx::Transform* quad_rect_transform, | 67 static void QuadRectTransform(gfx::Transform* quad_rect_transform, |
68 const gfx::Transform& quad_transform, | 68 const gfx::Transform& quad_transform, |
69 const gfx::RectF& quad_rect); | 69 const gfx::RectF& quad_rect); |
70 void InitializeViewport(DrawingFrame* frame, | 70 void InitializeViewport(DrawingFrame* frame, |
71 const gfx::Rect& draw_rect, | 71 const gfx::Rect& draw_rect, |
72 const gfx::Rect& viewport_rect, | 72 const gfx::Rect& viewport_rect, |
73 const gfx::Size& surface_size); | 73 const gfx::Size& surface_size); |
74 gfx::Rect MoveFromDrawToWindowSpace(const gfx::Rect& draw_rect) const; | 74 gfx::Rect MoveFromDrawToWindowSpace(const DrawingFrame* frame, |
| 75 const gfx::Rect& draw_rect) const; |
75 | 76 |
76 bool NeedDeviceClip(const DrawingFrame* frame) const; | 77 bool NeedDeviceClip(const DrawingFrame* frame) const; |
77 gfx::Rect DeviceClipRectInWindowSpace(const DrawingFrame* frame) const; | 78 gfx::Rect DeviceClipRectInWindowSpace(const DrawingFrame* frame) const; |
78 static gfx::Rect ComputeScissorRectForRenderPass(const DrawingFrame* frame); | 79 static gfx::Rect ComputeScissorRectForRenderPass(const DrawingFrame* frame); |
79 void SetScissorStateForQuad(const DrawingFrame* frame, const DrawQuad& quad); | 80 void SetScissorStateForQuad(const DrawingFrame* frame, const DrawQuad& quad); |
80 void SetScissorStateForQuadWithRenderPassScissor( | 81 void SetScissorStateForQuadWithRenderPassScissor( |
81 const DrawingFrame* frame, | 82 const DrawingFrame* frame, |
82 const DrawQuad& quad, | 83 const DrawQuad& quad, |
83 const gfx::Rect& render_pass_scissor, | 84 const gfx::Rect& render_pass_scissor, |
84 bool* should_skip_quad); | 85 bool* should_skip_quad); |
(...skipping 12 matching lines...) Expand all Loading... |
97 virtual void SetDrawViewport(const gfx::Rect& window_space_viewport) = 0; | 98 virtual void SetDrawViewport(const gfx::Rect& window_space_viewport) = 0; |
98 virtual void SetScissorTestRect(const gfx::Rect& scissor_rect) = 0; | 99 virtual void SetScissorTestRect(const gfx::Rect& scissor_rect) = 0; |
99 virtual void DiscardPixels(bool has_external_stencil_test, | 100 virtual void DiscardPixels(bool has_external_stencil_test, |
100 bool draw_rect_covers_full_surface) = 0; | 101 bool draw_rect_covers_full_surface) = 0; |
101 virtual void ClearFramebuffer(DrawingFrame* frame, | 102 virtual void ClearFramebuffer(DrawingFrame* frame, |
102 bool has_external_stencil_test) = 0; | 103 bool has_external_stencil_test) = 0; |
103 virtual void DoDrawQuad(DrawingFrame* frame, const DrawQuad* quad) = 0; | 104 virtual void DoDrawQuad(DrawingFrame* frame, const DrawQuad* quad) = 0; |
104 virtual void BeginDrawingFrame(DrawingFrame* frame) = 0; | 105 virtual void BeginDrawingFrame(DrawingFrame* frame) = 0; |
105 virtual void FinishDrawingFrame(DrawingFrame* frame) = 0; | 106 virtual void FinishDrawingFrame(DrawingFrame* frame) = 0; |
106 virtual void FinishDrawingQuadList(); | 107 virtual void FinishDrawingQuadList(); |
107 virtual bool FlippedFramebuffer() const = 0; | 108 virtual bool FlippedFramebuffer(const DrawingFrame* frame) const = 0; |
108 virtual void EnsureScissorTestEnabled() = 0; | 109 virtual void EnsureScissorTestEnabled() = 0; |
109 virtual void EnsureScissorTestDisabled() = 0; | 110 virtual void EnsureScissorTestDisabled() = 0; |
110 virtual void DiscardBackbuffer() {} | 111 virtual void DiscardBackbuffer() {} |
111 virtual void EnsureBackbuffer() {} | 112 virtual void EnsureBackbuffer() {} |
112 | 113 |
113 virtual void CopyCurrentRenderPassToBitmap( | 114 virtual void CopyCurrentRenderPassToBitmap( |
114 DrawingFrame* frame, | 115 DrawingFrame* frame, |
115 scoped_ptr<CopyOutputRequest> request) = 0; | 116 scoped_ptr<CopyOutputRequest> request) = 0; |
116 | 117 |
117 base::ScopedPtrHashMap<RenderPassId, ScopedResource> render_pass_textures_; | 118 base::ScopedPtrHashMap<RenderPassId, ScopedResource> render_pass_textures_; |
(...skipping 12 matching lines...) Expand all Loading... |
130 | 131 |
131 private: | 132 private: |
132 gfx::Vector2d enlarge_pass_texture_amount_; | 133 gfx::Vector2d enlarge_pass_texture_amount_; |
133 | 134 |
134 DISALLOW_COPY_AND_ASSIGN(DirectRenderer); | 135 DISALLOW_COPY_AND_ASSIGN(DirectRenderer); |
135 }; | 136 }; |
136 | 137 |
137 } // namespace cc | 138 } // namespace cc |
138 | 139 |
139 #endif // CC_OUTPUT_DIRECT_RENDERER_H_ | 140 #endif // CC_OUTPUT_DIRECT_RENDERER_H_ |
OLD | NEW |