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 "base/cancelable_callback.h" | 8 #include "base/cancelable_callback.h" |
9 #include "cc/base/cc_export.h" | 9 #include "cc/base/cc_export.h" |
10 #include "cc/base/scoped_ptr_vector.h" | 10 #include "cc/base/scoped_ptr_vector.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 namespace WebKit { class WebGraphicsContext3D; } | 26 namespace WebKit { class WebGraphicsContext3D; } |
27 | 27 |
28 namespace cc { | 28 namespace cc { |
29 | 29 |
30 class GLRendererShaderTest; | 30 class GLRendererShaderTest; |
31 class OutputSurface; | 31 class OutputSurface; |
32 class PictureDrawQuad; | 32 class PictureDrawQuad; |
33 class ScopedResource; | 33 class ScopedResource; |
34 class StreamVideoDrawQuad; | 34 class StreamVideoDrawQuad; |
35 class TextureDrawQuad; | 35 class TextureDrawQuad; |
| 36 class TextureMailboxDeleter; |
36 class GeometryBinding; | 37 class GeometryBinding; |
37 class ScopedEnsureFramebufferAllocation; | 38 class ScopedEnsureFramebufferAllocation; |
38 | 39 |
39 // Class that handles drawing of composited render layers using GL. | 40 // Class that handles drawing of composited render layers using GL. |
40 class CC_EXPORT GLRenderer : public DirectRenderer { | 41 class CC_EXPORT GLRenderer : public DirectRenderer { |
41 public: | 42 public: |
42 static scoped_ptr<GLRenderer> Create(RendererClient* client, | 43 static scoped_ptr<GLRenderer> Create( |
43 const LayerTreeSettings* settings, | 44 RendererClient* client, |
44 OutputSurface* output_surface, | 45 const LayerTreeSettings* settings, |
45 ResourceProvider* resource_provider, | 46 OutputSurface* output_surface, |
46 int highp_threshold_min, | 47 ResourceProvider* resource_provider, |
47 bool use_skia_gpu_backend); | 48 TextureMailboxDeleter* texture_mailbox_deleter, |
| 49 int highp_threshold_min, |
| 50 bool use_skia_gpu_backend); |
48 | 51 |
49 virtual ~GLRenderer(); | 52 virtual ~GLRenderer(); |
50 | 53 |
51 virtual const RendererCapabilities& Capabilities() const OVERRIDE; | 54 virtual const RendererCapabilities& Capabilities() const OVERRIDE; |
52 | 55 |
53 WebKit::WebGraphicsContext3D* Context(); | 56 WebKit::WebGraphicsContext3D* Context(); |
54 | 57 |
55 virtual void ViewportChanged() OVERRIDE; | 58 virtual void ViewportChanged() OVERRIDE; |
56 | 59 |
57 // Waits for rendering to finish. | 60 // Waits for rendering to finish. |
(...skipping 20 matching lines...) Expand all Loading... |
78 int line); | 81 int line); |
79 | 82 |
80 bool CanUseSkiaGPUBackend() const; | 83 bool CanUseSkiaGPUBackend() const; |
81 void LazyLabelOffscreenContext(ContextProvider* offscreen_context_provider); | 84 void LazyLabelOffscreenContext(ContextProvider* offscreen_context_provider); |
82 | 85 |
83 protected: | 86 protected: |
84 GLRenderer(RendererClient* client, | 87 GLRenderer(RendererClient* client, |
85 const LayerTreeSettings* settings, | 88 const LayerTreeSettings* settings, |
86 OutputSurface* output_surface, | 89 OutputSurface* output_surface, |
87 ResourceProvider* resource_provider, | 90 ResourceProvider* resource_provider, |
| 91 TextureMailboxDeleter* texture_mailbox_deleter, |
88 int highp_threshold_min); | 92 int highp_threshold_min); |
89 | 93 |
90 bool IsBackbufferDiscarded() const { return is_backbuffer_discarded_; } | 94 bool IsBackbufferDiscarded() const { return is_backbuffer_discarded_; } |
91 bool Initialize(); | 95 bool Initialize(); |
92 void InitializeGrContext(); | 96 void InitializeGrContext(); |
93 | 97 |
94 const gfx::QuadF& SharedGeometryQuad() const { return shared_geometry_quad_; } | 98 const gfx::QuadF& SharedGeometryQuad() const { return shared_geometry_quad_; } |
95 const GeometryBinding* SharedGeometry() const { | 99 const GeometryBinding* SharedGeometry() const { |
96 return shared_geometry_.get(); | 100 return shared_geometry_.get(); |
97 } | 101 } |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 | 422 |
419 scoped_ptr<DebugBorderProgram> debug_border_program_; | 423 scoped_ptr<DebugBorderProgram> debug_border_program_; |
420 scoped_ptr<SolidColorProgram> solid_color_program_; | 424 scoped_ptr<SolidColorProgram> solid_color_program_; |
421 scoped_ptr<SolidColorProgramAA> solid_color_program_aa_; | 425 scoped_ptr<SolidColorProgramAA> solid_color_program_aa_; |
422 | 426 |
423 WebKit::WebGraphicsContext3D* context_; | 427 WebKit::WebGraphicsContext3D* context_; |
424 | 428 |
425 skia::RefPtr<GrContext> gr_context_; | 429 skia::RefPtr<GrContext> gr_context_; |
426 skia::RefPtr<SkCanvas> sk_canvas_; | 430 skia::RefPtr<SkCanvas> sk_canvas_; |
427 | 431 |
| 432 TextureMailboxDeleter* texture_mailbox_deleter_; |
| 433 |
428 gfx::Rect swap_buffer_rect_; | 434 gfx::Rect swap_buffer_rect_; |
429 gfx::Rect scissor_rect_; | 435 gfx::Rect scissor_rect_; |
430 gfx::Rect viewport_; | 436 gfx::Rect viewport_; |
431 bool is_backbuffer_discarded_; | 437 bool is_backbuffer_discarded_; |
432 bool discard_backbuffer_when_not_visible_; | 438 bool discard_backbuffer_when_not_visible_; |
433 bool is_using_bind_uniform_; | 439 bool is_using_bind_uniform_; |
434 bool visible_; | 440 bool visible_; |
435 bool is_scissor_enabled_; | 441 bool is_scissor_enabled_; |
436 bool stencil_shadow_; | 442 bool stencil_shadow_; |
437 bool blend_shadow_; | 443 bool blend_shadow_; |
(...skipping 24 matching lines...) Expand all Loading... |
462 #if DEBUG_GL_CALLS && !defined(NDEBUG) | 468 #if DEBUG_GL_CALLS && !defined(NDEBUG) |
463 #define GLC(context, x) \ | 469 #define GLC(context, x) \ |
464 (x, GLRenderer::DebugGLCall(&* context, #x, __FILE__, __LINE__)) | 470 (x, GLRenderer::DebugGLCall(&* context, #x, __FILE__, __LINE__)) |
465 #else | 471 #else |
466 #define GLC(context, x) (x) | 472 #define GLC(context, x) (x) |
467 #endif | 473 #endif |
468 | 474 |
469 } // namespace cc | 475 } // namespace cc |
470 | 476 |
471 #endif // CC_OUTPUT_GL_RENDERER_H_ | 477 #endif // CC_OUTPUT_GL_RENDERER_H_ |
OLD | NEW |