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
3 // found in the LICENSE file.
5 #ifndef CC_OUTPUT_DELEGATING_RENDERER_H_
6 #define CC_OUTPUT_DELEGATING_RENDERER_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "cc/base/cc_export.h"
10 #include "cc/output/compositor_frame.h"
11 #include "cc/output/renderer.h"
16 class ResourceProvider
;
18 class CC_EXPORT DelegatingRenderer
: public Renderer
{
20 static scoped_ptr
<DelegatingRenderer
> Create(
21 RendererClient
* client
,
22 const RendererSettings
* settings
,
23 OutputSurface
* output_surface
,
24 ResourceProvider
* resource_provider
);
25 ~DelegatingRenderer() override
;
27 const RendererCapabilitiesImpl
& Capabilities() const override
;
29 void DrawFrame(RenderPassList
* render_passes_in_draw_order
,
30 float device_scale_factor
,
31 const gfx::Rect
& device_viewport_rect
,
32 const gfx::Rect
& device_clip_rect
,
33 bool disable_picture_quad_image_filtering
) override
;
35 void Finish() override
{}
37 void SwapBuffers(const CompositorFrameMetadata
& metadata
) override
;
38 void ReceiveSwapBuffersAck(const CompositorFrameAck
&) override
;
41 DelegatingRenderer(RendererClient
* client
,
42 const RendererSettings
* settings
,
43 OutputSurface
* output_surface
,
44 ResourceProvider
* resource_provider
);
46 void DidChangeVisibility() override
;
48 OutputSurface
* output_surface_
;
49 ResourceProvider
* resource_provider_
;
50 RendererCapabilitiesImpl capabilities_
;
51 scoped_ptr
<DelegatedFrameData
> delegated_frame_data_
;
53 DISALLOW_COPY_AND_ASSIGN(DelegatingRenderer
);
58 #endif // CC_OUTPUT_DELEGATING_RENDERER_H_