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 OutputSurface* output_surface, | 23 OutputSurface* output_surface, |
23 ResourceProvider* resource_provider); | 24 ResourceProvider* resource_provider); |
24 virtual ~DelegatingRenderer(); | 25 virtual ~DelegatingRenderer(); |
25 | 26 |
26 virtual const RendererCapabilities& Capabilities() const OVERRIDE; | 27 virtual const RendererCapabilities& Capabilities() const OVERRIDE; |
27 | 28 |
28 virtual bool CanReadPixels() const OVERRIDE; | 29 virtual bool CanReadPixels() const OVERRIDE; |
29 | 30 |
30 virtual void DrawFrame(RenderPassList* render_passes_in_draw_order, | 31 virtual void DrawFrame(RenderPassList* render_passes_in_draw_order, |
31 ContextProvider* offscreen_context_provider) OVERRIDE; | 32 ContextProvider* offscreen_context_provider, |
| 33 float device_scale_factor, |
| 34 bool allow_partial_swap) OVERRIDE; |
32 | 35 |
33 virtual void Finish() OVERRIDE {} | 36 virtual void Finish() OVERRIDE {} |
34 | 37 |
35 virtual void SwapBuffers() OVERRIDE; | 38 virtual void SwapBuffers() OVERRIDE; |
36 virtual void ReceiveSwapBuffersAck(const CompositorFrameAck&) OVERRIDE; | 39 virtual void ReceiveSwapBuffersAck(const CompositorFrameAck&) OVERRIDE; |
37 | 40 |
38 virtual void GetFramebufferPixels(void* pixels, gfx::Rect rect) OVERRIDE; | 41 virtual void GetFramebufferPixels(void* pixels, gfx::Rect rect) OVERRIDE; |
39 | 42 |
40 virtual bool IsContextLost() OVERRIDE; | 43 virtual bool IsContextLost() OVERRIDE; |
41 | 44 |
42 virtual void SetVisible(bool visible) OVERRIDE; | 45 virtual void SetVisible(bool visible) OVERRIDE; |
43 | 46 |
44 virtual void SendManagedMemoryStats(size_t bytes_visible, | 47 virtual void SendManagedMemoryStats(size_t bytes_visible, |
45 size_t bytes_visible_and_nearby, | 48 size_t bytes_visible_and_nearby, |
46 size_t bytes_allocated) OVERRIDE; | 49 size_t bytes_allocated) OVERRIDE; |
47 | 50 |
48 virtual void SetDiscardBackBufferWhenNotVisible(bool discard) OVERRIDE; | 51 virtual void SetDiscardBackBufferWhenNotVisible(bool discard) OVERRIDE; |
49 | 52 |
50 private: | 53 private: |
51 DelegatingRenderer(RendererClient* client, | 54 DelegatingRenderer(RendererClient* client, |
| 55 const LayerTreeSettings* settings, |
52 OutputSurface* output_surface, | 56 OutputSurface* output_surface, |
53 ResourceProvider* resource_provider); | 57 ResourceProvider* resource_provider); |
54 bool Initialize(); | 58 bool Initialize(); |
55 | 59 |
56 OutputSurface* output_surface_; | 60 OutputSurface* output_surface_; |
57 ResourceProvider* resource_provider_; | 61 ResourceProvider* resource_provider_; |
58 RendererCapabilities capabilities_; | 62 RendererCapabilities capabilities_; |
59 CompositorFrame frame_for_swap_buffers_; | 63 CompositorFrame frame_for_swap_buffers_; |
60 bool visible_; | 64 bool visible_; |
61 | 65 |
62 DISALLOW_COPY_AND_ASSIGN(DelegatingRenderer); | 66 DISALLOW_COPY_AND_ASSIGN(DelegatingRenderer); |
63 }; | 67 }; |
64 | 68 |
65 } // namespace cc | 69 } // namespace cc |
66 | 70 |
67 #endif // CC_OUTPUT_DELEGATING_RENDERER_H_ | 71 #endif // CC_OUTPUT_DELEGATING_RENDERER_H_ |
OLD | NEW |