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 <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "cc/base/cc_export.h" | 11 #include "cc/base/cc_export.h" |
12 #include "cc/output/compositor_frame.h" | 12 #include "cc/output/compositor_frame.h" |
13 #include "cc/output/renderer.h" | 13 #include "cc/output/renderer_capabilities_impl.h" |
14 | 14 |
15 namespace cc { | 15 namespace cc { |
16 | |
17 class OutputSurface; | 16 class OutputSurface; |
18 class ResourceProvider; | 17 class ResourceProvider; |
19 | 18 |
20 class CC_EXPORT DelegatingRenderer : public Renderer { | 19 class CC_EXPORT DelegatingRenderer { |
21 public: | 20 public: |
22 DelegatingRenderer(const RendererSettings* settings, | 21 DelegatingRenderer(OutputSurface* output_surface, |
23 OutputSurface* output_surface, | |
24 ResourceProvider* resource_provider); | 22 ResourceProvider* resource_provider); |
25 ~DelegatingRenderer() override; | 23 ~DelegatingRenderer(); |
26 | 24 |
27 const RendererCapabilitiesImpl& Capabilities() const override; | 25 const RendererCapabilitiesImpl& Capabilities() const { return capabilities_; } |
28 | 26 |
29 void DrawFrame(RenderPassList* render_passes_in_draw_order, | 27 void DrawFrame(RenderPassList* render_passes_in_draw_order); |
30 float device_scale_factor, | |
31 const gfx::ColorSpace& device_color_space, | |
32 const gfx::Rect& device_viewport_rect, | |
33 const gfx::Rect& device_clip_rect) override; | |
34 | 28 |
35 void SwapBuffers(CompositorFrameMetadata metadata) override; | 29 void SwapBuffers(CompositorFrameMetadata metadata); |
36 void ReclaimResources(const ReturnedResourceArray&) override; | |
37 | 30 |
38 private: | 31 private: |
39 OutputSurface* output_surface_; | 32 OutputSurface* const output_surface_; |
40 ResourceProvider* resource_provider_; | 33 ResourceProvider* const resource_provider_; |
41 RendererCapabilitiesImpl capabilities_; | 34 RendererCapabilitiesImpl capabilities_; |
42 std::unique_ptr<DelegatedFrameData> delegated_frame_data_; | 35 std::unique_ptr<DelegatedFrameData> delegated_frame_data_; |
43 | 36 |
44 DISALLOW_COPY_AND_ASSIGN(DelegatingRenderer); | 37 DISALLOW_COPY_AND_ASSIGN(DelegatingRenderer); |
45 }; | 38 }; |
46 | 39 |
47 } // namespace cc | 40 } // namespace cc |
48 | 41 |
49 #endif // CC_OUTPUT_DELEGATING_RENDERER_H_ | 42 #endif // CC_OUTPUT_DELEGATING_RENDERER_H_ |
OLD | NEW |