| OLD | NEW |
| 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_DELEGATING_RENDERER_H_ | 5 #ifndef CC_OUTPUT_DELEGATING_RENDERER_H_ |
| 6 #define CC_OUTPUT_DELEGATING_RENDERER_H_ | 6 #define CC_OUTPUT_DELEGATING_RENDERER_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "cc/base/cc_export.h" | 9 #include "cc/base/cc_export.h" |
| 10 #include "cc/output/compositor_frame.h" | 10 #include "cc/output/compositor_frame.h" |
| 11 #include "cc/output/renderer.h" | 11 #include "cc/output/renderer.h" |
| 12 | 12 |
| 13 namespace cc { | 13 namespace cc { |
| 14 | 14 |
| 15 class OutputSurface; | 15 class OutputSurface; |
| 16 class ResourceProvider; | 16 class ResourceProvider; |
| 17 | 17 |
| 18 class CC_EXPORT DelegatingRenderer : public Renderer { | 18 class CC_EXPORT DelegatingRenderer : public Renderer { |
| 19 public: | 19 public: |
| 20 static scoped_ptr<DelegatingRenderer> Create( | 20 static scoped_ptr<DelegatingRenderer> Create( |
| 21 RendererClient* client, | 21 RendererClient* client, |
| 22 const LayerTreeSettings* settings, | 22 const LayerTreeSettings* settings, |
| 23 OutputSurface* output_surface, | 23 OutputSurface* output_surface, |
| 24 ResourceProvider* resource_provider); | 24 ResourceProvider* resource_provider); |
| 25 virtual ~DelegatingRenderer(); | 25 virtual ~DelegatingRenderer(); |
| 26 | 26 |
| 27 virtual const RendererCapabilitiesImpl& Capabilities() const OVERRIDE; | 27 virtual const RendererCapabilitiesImpl& Capabilities() const OVERRIDE; |
| 28 | 28 |
| 29 virtual bool CanReadPixels() const OVERRIDE; | |
| 30 | |
| 31 virtual void DrawFrame(RenderPassList* render_passes_in_draw_order, | 29 virtual void DrawFrame(RenderPassList* render_passes_in_draw_order, |
| 32 float device_scale_factor, | 30 float device_scale_factor, |
| 33 const gfx::Rect& device_viewport_rect, | 31 const gfx::Rect& device_viewport_rect, |
| 34 const gfx::Rect& device_clip_rect, | 32 const gfx::Rect& device_clip_rect, |
| 35 bool disable_picture_quad_image_filtering) OVERRIDE; | 33 bool disable_picture_quad_image_filtering) OVERRIDE; |
| 36 | 34 |
| 37 virtual void Finish() OVERRIDE {} | 35 virtual void Finish() OVERRIDE {} |
| 38 | 36 |
| 39 virtual void SwapBuffers(const CompositorFrameMetadata& metadata) OVERRIDE; | 37 virtual void SwapBuffers(const CompositorFrameMetadata& metadata) OVERRIDE; |
| 40 virtual void ReceiveSwapBuffersAck(const CompositorFrameAck&) OVERRIDE; | 38 virtual void ReceiveSwapBuffersAck(const CompositorFrameAck&) OVERRIDE; |
| 41 | 39 |
| 42 virtual void GetFramebufferPixels(void* pixels, | |
| 43 const gfx::Rect& rect) OVERRIDE; | |
| 44 | |
| 45 virtual bool IsContextLost() OVERRIDE; | 40 virtual bool IsContextLost() OVERRIDE; |
| 46 | 41 |
| 47 virtual void SendManagedMemoryStats(size_t bytes_visible, | 42 virtual void SendManagedMemoryStats(size_t bytes_visible, |
| 48 size_t bytes_visible_and_nearby, | 43 size_t bytes_visible_and_nearby, |
| 49 size_t bytes_allocated) OVERRIDE; | 44 size_t bytes_allocated) OVERRIDE; |
| 50 | 45 |
| 51 private: | 46 private: |
| 52 DelegatingRenderer(RendererClient* client, | 47 DelegatingRenderer(RendererClient* client, |
| 53 const LayerTreeSettings* settings, | 48 const LayerTreeSettings* settings, |
| 54 OutputSurface* output_surface, | 49 OutputSurface* output_surface, |
| 55 ResourceProvider* resource_provider); | 50 ResourceProvider* resource_provider); |
| 56 | 51 |
| 57 virtual void DidChangeVisibility() OVERRIDE; | 52 virtual void DidChangeVisibility() OVERRIDE; |
| 58 | 53 |
| 59 OutputSurface* output_surface_; | 54 OutputSurface* output_surface_; |
| 60 ResourceProvider* resource_provider_; | 55 ResourceProvider* resource_provider_; |
| 61 RendererCapabilitiesImpl capabilities_; | 56 RendererCapabilitiesImpl capabilities_; |
| 62 scoped_ptr<DelegatedFrameData> delegated_frame_data_; | 57 scoped_ptr<DelegatedFrameData> delegated_frame_data_; |
| 63 | 58 |
| 64 DISALLOW_COPY_AND_ASSIGN(DelegatingRenderer); | 59 DISALLOW_COPY_AND_ASSIGN(DelegatingRenderer); |
| 65 }; | 60 }; |
| 66 | 61 |
| 67 } // namespace cc | 62 } // namespace cc |
| 68 | 63 |
| 69 #endif // CC_OUTPUT_DELEGATING_RENDERER_H_ | 64 #endif // CC_OUTPUT_DELEGATING_RENDERER_H_ |
| OLD | NEW |