Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(467)

Side by Side Diff: cc/output/direct_renderer.h

Issue 595593002: Splitting of layers for correct intersections (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/base/scoped_ptr_deque.h"
12 #include "cc/output/overlay_processor.h" 13 #include "cc/output/overlay_processor.h"
13 #include "cc/output/renderer.h" 14 #include "cc/output/renderer.h"
14 #include "cc/resources/resource_provider.h" 15 #include "cc/resources/resource_provider.h"
15 #include "cc/resources/scoped_resource.h" 16 #include "cc/resources/scoped_resource.h"
17 #include "cc/resources/task_graph_runner.h"
18 #include "ui/gfx/quad_f.h"
16 19
17 namespace cc { 20 namespace cc {
18 21
22 class DrawPolygon;
19 class ResourceProvider; 23 class ResourceProvider;
20 24
21 // This is the base class for code shared between the GL and software 25 // This is the base class for code shared between the GL and software
22 // renderer implementations. "Direct" refers to the fact that it does not 26 // renderer implementations. "Direct" refers to the fact that it does not
23 // delegate rendering to another compositor. 27 // delegate rendering to another compositor.
24 class CC_EXPORT DirectRenderer : public Renderer { 28 class CC_EXPORT DirectRenderer : public Renderer {
25 public: 29 public:
26 virtual ~DirectRenderer(); 30 virtual ~DirectRenderer();
27 31
28 virtual void DecideRenderPassAllocationsForFrame( 32 virtual void DecideRenderPassAllocationsForFrame(
(...skipping 20 matching lines...) Expand all
49 53
50 gfx::Transform projection_matrix; 54 gfx::Transform projection_matrix;
51 gfx::Transform window_matrix; 55 gfx::Transform window_matrix;
52 56
53 bool disable_picture_quad_image_filtering; 57 bool disable_picture_quad_image_filtering;
54 58
55 OverlayCandidateList overlay_list; 59 OverlayCandidateList overlay_list;
56 }; 60 };
57 61
58 void SetEnlargePassTextureAmountForTesting(const gfx::Vector2d& amount); 62 void SetEnlargePassTextureAmountForTesting(const gfx::Vector2d& amount);
63 void DoDrawPolygon(const DrawPolygon& poly, DrawingFrame* frame,
64 const gfx::Rect& render_pass_scissor,
65 bool using_scissor_as_optimization);
59 66
60 protected: 67 protected:
61 DirectRenderer(RendererClient* client, 68 DirectRenderer(RendererClient* client,
62 const LayerTreeSettings* settings, 69 const LayerTreeSettings* settings,
63 OutputSurface* output_surface, 70 OutputSurface* output_surface,
64 ResourceProvider* resource_provider); 71 ResourceProvider* resource_provider);
65 72
66 static gfx::RectF QuadVertexRect(); 73 static gfx::RectF QuadVertexRect();
67 static void QuadRectTransform(gfx::Transform* quad_rect_transform, 74 static void QuadRectTransform(gfx::Transform* quad_rect_transform,
68 const gfx::Transform& quad_transform, 75 const gfx::Transform& quad_transform,
69 const gfx::RectF& quad_rect); 76 const gfx::RectF& quad_rect);
70 void InitializeViewport(DrawingFrame* frame, 77 void InitializeViewport(DrawingFrame* frame,
71 const gfx::Rect& draw_rect, 78 const gfx::Rect& draw_rect,
72 const gfx::Rect& viewport_rect, 79 const gfx::Rect& viewport_rect,
73 const gfx::Size& surface_size); 80 const gfx::Size& surface_size);
74 gfx::Rect MoveFromDrawToWindowSpace(const gfx::Rect& draw_rect) const; 81 gfx::Rect MoveFromDrawToWindowSpace(const gfx::Rect& draw_rect) const;
75 82
76 bool NeedDeviceClip(const DrawingFrame* frame) const; 83 bool NeedDeviceClip(const DrawingFrame* frame) const;
77 gfx::Rect DeviceClipRectInWindowSpace(const DrawingFrame* frame) const; 84 gfx::Rect DeviceClipRectInWindowSpace(const DrawingFrame* frame) const;
78 static gfx::Rect ComputeScissorRectForRenderPass(const DrawingFrame* frame); 85 static gfx::Rect ComputeScissorRectForRenderPass(const DrawingFrame* frame);
79 void SetScissorStateForQuad(const DrawingFrame* frame, const DrawQuad& quad); 86 void SetScissorStateForQuad(const DrawingFrame* frame, const DrawQuad& quad);
87 bool ShouldSkipQuad(
88 const DrawQuad& quad,
89 const gfx::Rect& render_pass_scissor);
80 void SetScissorStateForQuadWithRenderPassScissor( 90 void SetScissorStateForQuadWithRenderPassScissor(
81 const DrawingFrame* frame, 91 const DrawingFrame* frame,
82 const DrawQuad& quad, 92 const DrawQuad& quad,
83 const gfx::Rect& render_pass_scissor, 93 const gfx::Rect& render_pass_scissor);
84 bool* should_skip_quad);
85 void SetScissorTestRectInDrawSpace(const DrawingFrame* frame, 94 void SetScissorTestRectInDrawSpace(const DrawingFrame* frame,
86 const gfx::Rect& draw_space_rect); 95 const gfx::Rect& draw_space_rect);
87 96
88 static gfx::Size RenderPassTextureSize(const RenderPass* render_pass); 97 static gfx::Size RenderPassTextureSize(const RenderPass* render_pass);
89 98
99 void FlushPolygons(ScopedPtrDeque<DrawPolygon>* poly_list,
100 DrawingFrame* frame,
101 const gfx::Rect& render_pass_scissor,
102 bool using_scissor_as_optimization);
90 void DrawRenderPass(DrawingFrame* frame, const RenderPass* render_pass); 103 void DrawRenderPass(DrawingFrame* frame, const RenderPass* render_pass);
91 bool UseRenderPass(DrawingFrame* frame, const RenderPass* render_pass); 104 bool UseRenderPass(DrawingFrame* frame, const RenderPass* render_pass);
92 105
93 virtual void BindFramebufferToOutputSurface(DrawingFrame* frame) = 0; 106 virtual void BindFramebufferToOutputSurface(DrawingFrame* frame) = 0;
94 virtual bool BindFramebufferToTexture(DrawingFrame* frame, 107 virtual bool BindFramebufferToTexture(DrawingFrame* frame,
95 const ScopedResource* resource, 108 const ScopedResource* resource,
96 const gfx::Rect& target_rect) = 0; 109 const gfx::Rect& target_rect) = 0;
97 virtual void SetDrawViewport(const gfx::Rect& window_space_viewport) = 0; 110 virtual void SetDrawViewport(const gfx::Rect& window_space_viewport) = 0;
98 virtual void SetScissorTestRect(const gfx::Rect& scissor_rect) = 0; 111 virtual void SetScissorTestRect(const gfx::Rect& scissor_rect) = 0;
99 virtual void DiscardPixels(bool has_external_stencil_test, 112 virtual void DiscardPixels(bool has_external_stencil_test,
100 bool draw_rect_covers_full_surface) = 0; 113 bool draw_rect_covers_full_surface) = 0;
101 virtual void ClearFramebuffer(DrawingFrame* frame, 114 virtual void ClearFramebuffer(DrawingFrame* frame,
102 bool has_external_stencil_test) = 0; 115 bool has_external_stencil_test) = 0;
103 virtual void DoDrawQuad(DrawingFrame* frame, const DrawQuad* quad) = 0; 116 virtual void DoDrawQuad(DrawingFrame* frame,
117 const DrawQuad* quad,
118 const gfx::QuadF* draw_region = NULL) = 0;
104 virtual void BeginDrawingFrame(DrawingFrame* frame) = 0; 119 virtual void BeginDrawingFrame(DrawingFrame* frame) = 0;
105 virtual void FinishDrawingFrame(DrawingFrame* frame) = 0; 120 virtual void FinishDrawingFrame(DrawingFrame* frame) = 0;
106 virtual void FinishDrawingQuadList(); 121 virtual void FinishDrawingQuadList();
107 virtual bool FlippedFramebuffer() const = 0; 122 virtual bool FlippedFramebuffer() const = 0;
108 virtual void EnsureScissorTestEnabled() = 0; 123 virtual void EnsureScissorTestEnabled() = 0;
109 virtual void EnsureScissorTestDisabled() = 0; 124 virtual void EnsureScissorTestDisabled() = 0;
110 virtual void DiscardBackbuffer() {} 125 virtual void DiscardBackbuffer() {}
111 virtual void EnsureBackbuffer() {} 126 virtual void EnsureBackbuffer() {}
112 127
113 virtual void CopyCurrentRenderPassToBitmap( 128 virtual void CopyCurrentRenderPassToBitmap(
(...skipping 16 matching lines...) Expand all
130 145
131 private: 146 private:
132 gfx::Vector2d enlarge_pass_texture_amount_; 147 gfx::Vector2d enlarge_pass_texture_amount_;
133 148
134 DISALLOW_COPY_AND_ASSIGN(DirectRenderer); 149 DISALLOW_COPY_AND_ASSIGN(DirectRenderer);
135 }; 150 };
136 151
137 } // namespace cc 152 } // namespace cc
138 153
139 #endif // CC_OUTPUT_DIRECT_RENDERER_H_ 154 #endif // CC_OUTPUT_DIRECT_RENDERER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698