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

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

Issue 1001833005: Update from https://crrev.com/320343 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Supress Created 5 years, 9 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
« no previous file with comments | « cc/output/bsp_walk_action.cc ('k') | cc/output/direct_renderer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/geometry/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 ~DirectRenderer() override; 30 ~DirectRenderer() override;
27 31
28 void DecideRenderPassAllocationsForFrame( 32 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,
64 DrawingFrame* frame,
65 const gfx::Rect& render_pass_scissor,
66 bool using_scissor_as_optimization);
59 67
60 protected: 68 protected:
61 DirectRenderer(RendererClient* client, 69 DirectRenderer(RendererClient* client,
62 const RendererSettings* settings, 70 const RendererSettings* settings,
63 OutputSurface* output_surface, 71 OutputSurface* output_surface,
64 ResourceProvider* resource_provider); 72 ResourceProvider* resource_provider);
65 73
66 static gfx::RectF QuadVertexRect(); 74 static gfx::RectF QuadVertexRect();
67 static void QuadRectTransform(gfx::Transform* quad_rect_transform, 75 static void QuadRectTransform(gfx::Transform* quad_rect_transform,
68 const gfx::Transform& quad_transform, 76 const gfx::Transform& quad_transform,
69 const gfx::RectF& quad_rect); 77 const gfx::RectF& quad_rect);
70 void InitializeViewport(DrawingFrame* frame, 78 void InitializeViewport(DrawingFrame* frame,
71 const gfx::Rect& draw_rect, 79 const gfx::Rect& draw_rect,
72 const gfx::Rect& viewport_rect, 80 const gfx::Rect& viewport_rect,
73 const gfx::Size& surface_size); 81 const gfx::Size& surface_size);
74 gfx::Rect MoveFromDrawToWindowSpace(const DrawingFrame* frame, 82 gfx::Rect MoveFromDrawToWindowSpace(const DrawingFrame* frame,
75 const gfx::Rect& draw_rect) const; 83 const gfx::Rect& draw_rect) const;
76 84
77 bool NeedDeviceClip(const DrawingFrame* frame) const; 85 bool NeedDeviceClip(const DrawingFrame* frame) const;
78 gfx::Rect DeviceClipRectInWindowSpace(const DrawingFrame* frame) const; 86 gfx::Rect DeviceClipRectInWindowSpace(const DrawingFrame* frame) const;
79 static gfx::Rect ComputeScissorRectForRenderPass(const DrawingFrame* frame); 87 static gfx::Rect ComputeScissorRectForRenderPass(const DrawingFrame* frame);
80 void SetScissorStateForQuad(const DrawingFrame* frame, const DrawQuad& quad); 88 void SetScissorStateForQuad(const DrawingFrame* frame, const DrawQuad& quad);
89 bool ShouldSkipQuad(const DrawQuad& quad,
90 const gfx::Rect& render_pass_scissor);
81 void SetScissorStateForQuadWithRenderPassScissor( 91 void SetScissorStateForQuadWithRenderPassScissor(
82 const DrawingFrame* frame, 92 const DrawingFrame* frame,
83 const DrawQuad& quad, 93 const DrawQuad& quad,
84 const gfx::Rect& render_pass_scissor, 94 const gfx::Rect& render_pass_scissor);
85 bool* should_skip_quad);
86 void SetScissorTestRectInDrawSpace(const DrawingFrame* frame, 95 void SetScissorTestRectInDrawSpace(const DrawingFrame* frame,
87 const gfx::Rect& draw_space_rect); 96 const gfx::Rect& draw_space_rect);
88 97
89 static gfx::Size RenderPassTextureSize(const RenderPass* render_pass); 98 static gfx::Size RenderPassTextureSize(const RenderPass* render_pass);
90 99
100 void FlushPolygons(ScopedPtrDeque<DrawPolygon>* poly_list,
101 DrawingFrame* frame,
102 const gfx::Rect& render_pass_scissor,
103 bool using_scissor_as_optimization);
91 void DrawRenderPass(DrawingFrame* frame, const RenderPass* render_pass); 104 void DrawRenderPass(DrawingFrame* frame, const RenderPass* render_pass);
92 bool UseRenderPass(DrawingFrame* frame, const RenderPass* render_pass); 105 bool UseRenderPass(DrawingFrame* frame, const RenderPass* render_pass);
93 106
94 virtual void BindFramebufferToOutputSurface(DrawingFrame* frame) = 0; 107 virtual void BindFramebufferToOutputSurface(DrawingFrame* frame) = 0;
95 virtual bool BindFramebufferToTexture(DrawingFrame* frame, 108 virtual bool BindFramebufferToTexture(DrawingFrame* frame,
96 const ScopedResource* resource, 109 const ScopedResource* resource,
97 const gfx::Rect& target_rect) = 0; 110 const gfx::Rect& target_rect) = 0;
98 virtual void SetDrawViewport(const gfx::Rect& window_space_viewport) = 0; 111 virtual void SetDrawViewport(const gfx::Rect& window_space_viewport) = 0;
99 virtual void SetScissorTestRect(const gfx::Rect& scissor_rect) = 0; 112 virtual void SetScissorTestRect(const gfx::Rect& scissor_rect) = 0;
100 virtual void DiscardPixels(bool has_external_stencil_test, 113 virtual void DiscardPixels(bool has_external_stencil_test,
101 bool draw_rect_covers_full_surface) = 0; 114 bool draw_rect_covers_full_surface) = 0;
102 virtual void ClearFramebuffer(DrawingFrame* frame, 115 virtual void ClearFramebuffer(DrawingFrame* frame,
103 bool has_external_stencil_test) = 0; 116 bool has_external_stencil_test) = 0;
104 virtual void DoDrawQuad(DrawingFrame* frame, const DrawQuad* quad) = 0; 117 // clip_region is a (possibly null) pointer to a quad in the same
118 // space as the quad. When non-null only the area of the quad that overlaps
119 // with clip_region will be drawn.
120 virtual void DoDrawQuad(DrawingFrame* frame,
121 const DrawQuad* quad,
122 const gfx::QuadF* clip_region) = 0;
105 virtual void BeginDrawingFrame(DrawingFrame* frame) = 0; 123 virtual void BeginDrawingFrame(DrawingFrame* frame) = 0;
106 virtual void FinishDrawingFrame(DrawingFrame* frame) = 0; 124 virtual void FinishDrawingFrame(DrawingFrame* frame) = 0;
107 virtual void FinishDrawingQuadList(); 125 virtual void FinishDrawingQuadList();
108 virtual bool FlippedFramebuffer(const DrawingFrame* frame) const = 0; 126 virtual bool FlippedFramebuffer(const DrawingFrame* frame) const = 0;
109 virtual void EnsureScissorTestEnabled() = 0; 127 virtual void EnsureScissorTestEnabled() = 0;
110 virtual void EnsureScissorTestDisabled() = 0; 128 virtual void EnsureScissorTestDisabled() = 0;
111 virtual void DiscardBackbuffer() {} 129 virtual void DiscardBackbuffer() {}
112 virtual void EnsureBackbuffer() {} 130 virtual void EnsureBackbuffer() {}
113 131
114 virtual void CopyCurrentRenderPassToBitmap( 132 virtual void CopyCurrentRenderPassToBitmap(
(...skipping 16 matching lines...) Expand all
131 149
132 private: 150 private:
133 gfx::Vector2d enlarge_pass_texture_amount_; 151 gfx::Vector2d enlarge_pass_texture_amount_;
134 152
135 DISALLOW_COPY_AND_ASSIGN(DirectRenderer); 153 DISALLOW_COPY_AND_ASSIGN(DirectRenderer);
136 }; 154 };
137 155
138 } // namespace cc 156 } // namespace cc
139 157
140 #endif // CC_OUTPUT_DIRECT_RENDERER_H_ 158 #endif // CC_OUTPUT_DIRECT_RENDERER_H_
OLDNEW
« no previous file with comments | « cc/output/bsp_walk_action.cc ('k') | cc/output/direct_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698