Chromium Code Reviews| Index: cc/output/direct_renderer.h |
| diff --git a/cc/output/direct_renderer.h b/cc/output/direct_renderer.h |
| index 4baadeecbfbfd34f7312747441ae2abda5f3c2d8..7a86fa8a523ce74f21b1fefa89b01c425bf5abd7 100644 |
| --- a/cc/output/direct_renderer.h |
| +++ b/cc/output/direct_renderer.h |
| @@ -50,7 +50,9 @@ class CC_EXPORT DirectRenderer : public Renderer { |
| void SetEnlargePassTextureAmountForTesting(gfx::Vector2d amount); |
| protected: |
| - DirectRenderer(RendererClient* client, ResourceProvider* resource_provider); |
| + DirectRenderer(RendererClient* client, |
| + OutputSurface* output_surface, |
| + ResourceProvider* resource_provider); |
| class CachedResource : public ScopedResource { |
| public: |
| @@ -78,11 +80,14 @@ class CC_EXPORT DirectRenderer : public Renderer { |
| static void QuadRectTransform(gfx::Transform* quad_rect_transform, |
| const gfx::Transform& quad_transform, |
| const gfx::RectF& quad_rect); |
| - static void InitializeMatrices(DrawingFrame* frame, |
| - gfx::Rect draw_rect, |
| - bool flip_y); |
| - static gfx::Rect MoveScissorToWindowSpace(const DrawingFrame* frame, |
| - const gfx::RectF& scissor_rect); |
| + void InitializeViewport(DrawingFrame* frame, |
| + gfx::Rect draw_rect, |
| + gfx::Rect viewport_rect, |
| + gfx::Size surface_size, |
| + bool flip_y); |
| + gfx::Rect MoveFromDrawToWindowSpace(const gfx::RectF& draw_rect, |
| + bool flip_y) const; |
| + |
| static gfx::RectF ComputeScissorRectForRenderPass(const DrawingFrame* frame); |
| void SetScissorStateForQuad(const DrawingFrame* frame, const DrawQuad& quad); |
| void SetScissorStateForQuadWithRenderPassScissor( |
| @@ -100,8 +105,8 @@ class CC_EXPORT DirectRenderer : public Renderer { |
| virtual void BindFramebufferToOutputSurface(DrawingFrame* frame) = 0; |
| virtual bool BindFramebufferToTexture(DrawingFrame* frame, |
| const ScopedResource* resource, |
| - gfx::Rect framebuffer_rect) = 0; |
| - virtual void SetDrawViewportSize(gfx::Size viewport_size) = 0; |
| + gfx::Rect target_rect) = 0; |
| + virtual void SetDrawViewport(gfx::Rect window_space_viewport) = 0; |
| virtual void SetScissorTestRect(gfx::Rect scissor_rect) = 0; |
| virtual void ClearFramebuffer(DrawingFrame* frame) = 0; |
| virtual void DoDrawQuad(DrawingFrame* frame, const DrawQuad* quad) = 0; |
| @@ -117,8 +122,16 @@ class CC_EXPORT DirectRenderer : public Renderer { |
| scoped_ptr<CopyOutputRequest> request) = 0; |
| ScopedPtrHashMap<RenderPass::Id, CachedResource> render_pass_textures_; |
| + OutputSurface* output_surface_; |
| ResourceProvider* resource_provider_; |
| + // For use in coordinate conversion, this stores the current render-pass |
|
danakj
2013/06/06 19:03:13
Perviously all temporary data that only lived for
danakj
2013/06/06 19:06:01
No I guess this is not possible since the readback
aelias_OOO_until_Jul13
2013/06/06 19:10:59
It ends up being the root render pass since that o
|
| + // output rect, viewport rect (= unflipped version of glViewport rect), and |
| + // the size of target framebuffer. |
| + gfx::Rect current_draw_rect_; |
| + gfx::Rect current_viewport_rect_; |
| + gfx::Size current_surface_size_; |
| + |
| private: |
| gfx::Vector2d enlarge_pass_texture_amount_; |