OLD | NEW |
1 // Copyright 2010 The Chromium Authors. All rights reserved. | 1 // Copyright 2010 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_GL_RENDERER_H_ | 5 #ifndef CC_OUTPUT_GL_RENDERER_H_ |
6 #define CC_OUTPUT_GL_RENDERER_H_ | 6 #define CC_OUTPUT_GL_RENDERER_H_ |
7 | 7 |
8 #include "cc/base/cc_export.h" | 8 #include "cc/base/cc_export.h" |
9 #include "cc/output/direct_renderer.h" | 9 #include "cc/output/direct_renderer.h" |
10 #include "cc/output/gl_renderer_draw_cache.h" | 10 #include "cc/output/gl_renderer_draw_cache.h" |
11 #include "cc/output/renderer.h" | 11 #include "cc/output/renderer.h" |
12 #include "cc/quads/checkerboard_draw_quad.h" | 12 #include "cc/quads/checkerboard_draw_quad.h" |
13 #include "cc/quads/debug_border_draw_quad.h" | 13 #include "cc/quads/debug_border_draw_quad.h" |
14 #include "cc/quads/io_surface_draw_quad.h" | 14 #include "cc/quads/io_surface_draw_quad.h" |
15 #include "cc/quads/render_pass_draw_quad.h" | 15 #include "cc/quads/render_pass_draw_quad.h" |
16 #include "cc/quads/solid_color_draw_quad.h" | 16 #include "cc/quads/solid_color_draw_quad.h" |
17 #include "cc/quads/tile_draw_quad.h" | 17 #include "cc/quads/tile_draw_quad.h" |
18 #include "cc/quads/yuv_video_draw_quad.h" | 18 #include "cc/quads/yuv_video_draw_quad.h" |
19 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3
D.h" | 19 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3
D.h" |
20 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsMemoryAl
location.h" | 20 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsMemoryAl
location.h" |
21 #include "ui/gfx/quad_f.h" | 21 #include "ui/gfx/quad_f.h" |
| 22 #include "webkit/gpu/grcontext_for_webgraphicscontext3d.h" |
22 | 23 |
23 namespace cc { | 24 namespace cc { |
24 | 25 |
25 class GLRendererShaderTest; | 26 class GLRendererShaderTest; |
26 class OutputSurface; | 27 class OutputSurface; |
27 class PictureDrawQuad; | 28 class PictureDrawQuad; |
28 class ScopedResource; | 29 class ScopedResource; |
29 class StreamVideoDrawQuad; | 30 class StreamVideoDrawQuad; |
30 class TextureDrawQuad; | 31 class TextureDrawQuad; |
31 class GeometryBinding; | 32 class GeometryBinding; |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 void DrawIOSurfaceQuad(const DrawingFrame* frame, | 135 void DrawIOSurfaceQuad(const DrawingFrame* frame, |
135 const IOSurfaceDrawQuad* quad); | 136 const IOSurfaceDrawQuad* quad); |
136 void DrawTileQuad(const DrawingFrame* frame, const TileDrawQuad* quad); | 137 void DrawTileQuad(const DrawingFrame* frame, const TileDrawQuad* quad); |
137 void DrawContentQuad(const DrawingFrame* frame, | 138 void DrawContentQuad(const DrawingFrame* frame, |
138 const ContentDrawQuadBase* quad, | 139 const ContentDrawQuadBase* quad, |
139 ResourceProvider::ResourceId resource_id); | 140 ResourceProvider::ResourceId resource_id); |
140 void DrawYUVVideoQuad(const DrawingFrame* frame, | 141 void DrawYUVVideoQuad(const DrawingFrame* frame, |
141 const YUVVideoDrawQuad* quad); | 142 const YUVVideoDrawQuad* quad); |
142 void DrawPictureQuad(const DrawingFrame* frame, | 143 void DrawPictureQuad(const DrawingFrame* frame, |
143 const PictureDrawQuad* quad); | 144 const PictureDrawQuad* quad); |
| 145 void DrawPictureQuadDirectToBackbuffer(const DrawingFrame* frame, |
| 146 const PictureDrawQuad* quad); |
144 | 147 |
145 void SetShaderOpacity(float opacity, int alpha_location); | 148 void SetShaderOpacity(float opacity, int alpha_location); |
146 void SetShaderQuadF(const gfx::QuadF& quad, int quad_location); | 149 void SetShaderQuadF(const gfx::QuadF& quad, int quad_location); |
147 void DrawQuadGeometry(const DrawingFrame* frame, | 150 void DrawQuadGeometry(const DrawingFrame* frame, |
148 const gfx::Transform& draw_transform, | 151 const gfx::Transform& draw_transform, |
149 const gfx::RectF& quad_rect, | 152 const gfx::RectF& quad_rect, |
150 int matrix_location); | 153 int matrix_location); |
151 void SetBlendEnabled(bool enabled); | 154 void SetBlendEnabled(bool enabled); |
152 bool blend_enabled() const { return blend_shadow_; } | 155 bool blend_enabled() const { return blend_shadow_; } |
153 void SetUseProgram(unsigned program); | 156 void SetUseProgram(unsigned program); |
(...skipping 16 matching lines...) Expand all Loading... |
170 | 173 |
171 bool UseScopedTexture(DrawingFrame* frame, | 174 bool UseScopedTexture(DrawingFrame* frame, |
172 const ScopedResource* resource, | 175 const ScopedResource* resource, |
173 gfx::Rect viewport_rect); | 176 gfx::Rect viewport_rect); |
174 | 177 |
175 bool MakeContextCurrent(); | 178 bool MakeContextCurrent(); |
176 | 179 |
177 bool InitializeSharedObjects(); | 180 bool InitializeSharedObjects(); |
178 void CleanupSharedObjects(); | 181 void CleanupSharedObjects(); |
179 | 182 |
| 183 void ReinitializeGrContext(); |
| 184 void ReinitializeGLState(); |
| 185 |
180 // WebKit:: | 186 // WebKit:: |
181 // WebGraphicsContext3D::WebGraphicsMemoryAllocationChangedCallbackCHROMIUM | 187 // WebGraphicsContext3D::WebGraphicsMemoryAllocationChangedCallbackCHROMIUM |
182 // implementation. | 188 // implementation. |
183 virtual void onMemoryAllocationChanged( | 189 virtual void onMemoryAllocationChanged( |
184 WebKit::WebGraphicsMemoryAllocation allocation) OVERRIDE; | 190 WebKit::WebGraphicsMemoryAllocation allocation) OVERRIDE; |
185 void DiscardBackbuffer(); | 191 void DiscardBackbuffer(); |
186 void EnsureBackbuffer(); | 192 void EnsureBackbuffer(); |
187 void EnforceMemoryPolicy(); | 193 void EnforceMemoryPolicy(); |
188 | 194 |
189 RendererCapabilities capabilities_; | 195 RendererCapabilities capabilities_; |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 | 352 |
347 scoped_ptr<VideoYUVProgram> video_yuv_program_highp_; | 353 scoped_ptr<VideoYUVProgram> video_yuv_program_highp_; |
348 scoped_ptr<VideoStreamTextureProgram> video_stream_texture_program_highp_; | 354 scoped_ptr<VideoStreamTextureProgram> video_stream_texture_program_highp_; |
349 | 355 |
350 scoped_ptr<DebugBorderProgram> debug_border_program_; | 356 scoped_ptr<DebugBorderProgram> debug_border_program_; |
351 scoped_ptr<SolidColorProgram> solid_color_program_; | 357 scoped_ptr<SolidColorProgram> solid_color_program_; |
352 scoped_ptr<SolidColorProgramAA> solid_color_program_aa_; | 358 scoped_ptr<SolidColorProgramAA> solid_color_program_aa_; |
353 | 359 |
354 OutputSurface* output_surface_; | 360 OutputSurface* output_surface_; |
355 WebKit::WebGraphicsContext3D* context_; | 361 WebKit::WebGraphicsContext3D* context_; |
| 362 scoped_ptr<webkit::gpu::GrContextForWebGraphicsContext3D> gr_context_; |
| 363 SkAutoTUnref<SkCanvas> sk_canvas_; |
356 | 364 |
357 gfx::Rect swap_buffer_rect_; | 365 gfx::Rect swap_buffer_rect_; |
358 gfx::Rect scissor_rect_; | 366 gfx::Rect scissor_rect_; |
359 bool is_viewport_changed_; | 367 bool is_viewport_changed_; |
360 bool is_backbuffer_discarded_; | 368 bool is_backbuffer_discarded_; |
361 bool discard_backbuffer_when_not_visible_; | 369 bool discard_backbuffer_when_not_visible_; |
362 bool is_using_bind_uniform_; | 370 bool is_using_bind_uniform_; |
363 bool visible_; | 371 bool visible_; |
364 bool is_scissor_enabled_; | 372 bool is_scissor_enabled_; |
365 bool blend_shadow_; | 373 bool blend_shadow_; |
(...skipping 19 matching lines...) Expand all Loading... |
385 #if DEBUG_GL_CALLS && !defined(NDEBUG) | 393 #if DEBUG_GL_CALLS && !defined(NDEBUG) |
386 #define GLC(context, x) \ | 394 #define GLC(context, x) \ |
387 (x, GLRenderer::DebugGLCall(&* context, #x, __FILE__, __LINE__)) | 395 (x, GLRenderer::DebugGLCall(&* context, #x, __FILE__, __LINE__)) |
388 #else | 396 #else |
389 #define GLC(context, x) (x) | 397 #define GLC(context, x) (x) |
390 #endif | 398 #endif |
391 | 399 |
392 } // namespace cc | 400 } // namespace cc |
393 | 401 |
394 #endif // CC_OUTPUT_GL_RENDERER_H_ | 402 #endif // CC_OUTPUT_GL_RENDERER_H_ |
OLD | NEW |