Move prefs::kLastPolicyStatisticsUpdate to the policy component.
[chromium-blink-merge.git] / cc / output / delegating_renderer.h
blob57a2418c452145237a212221dc05a2ce9fa7fc2a
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"
13 namespace cc {
15 class OutputSurface;
16 class ResourceProvider;
18 class CC_EXPORT DelegatingRenderer : public Renderer {
19 public:
20 static scoped_ptr<DelegatingRenderer> Create(
21 RendererClient* client,
22 const LayerTreeSettings* settings,
23 OutputSurface* output_surface,
24 ResourceProvider* resource_provider);
25 virtual ~DelegatingRenderer();
27 virtual const RendererCapabilities& Capabilities() const OVERRIDE;
29 virtual bool CanReadPixels() const OVERRIDE;
31 virtual void DrawFrame(RenderPassList* render_passes_in_draw_order,
32 ContextProvider* offscreen_context_provider,
33 float device_scale_factor,
34 bool allow_partial_swap) OVERRIDE;
36 virtual void Finish() OVERRIDE {}
38 virtual void SwapBuffers() OVERRIDE;
39 virtual void ReceiveSwapBuffersAck(const CompositorFrameAck&) OVERRIDE;
41 virtual void GetFramebufferPixels(void* pixels, gfx::Rect rect) OVERRIDE;
43 virtual bool IsContextLost() OVERRIDE;
45 virtual void SetVisible(bool visible) OVERRIDE;
47 virtual void SendManagedMemoryStats(size_t bytes_visible,
48 size_t bytes_visible_and_nearby,
49 size_t bytes_allocated) OVERRIDE;
51 virtual void SetDiscardBackBufferWhenNotVisible(bool discard) OVERRIDE;
53 private:
54 DelegatingRenderer(RendererClient* client,
55 const LayerTreeSettings* settings,
56 OutputSurface* output_surface,
57 ResourceProvider* resource_provider);
58 bool Initialize();
60 OutputSurface* output_surface_;
61 ResourceProvider* resource_provider_;
62 RendererCapabilities capabilities_;
63 CompositorFrame frame_for_swap_buffers_;
64 bool visible_;
66 DISALLOW_COPY_AND_ASSIGN(DelegatingRenderer);
69 } // namespace cc
71 #endif // CC_OUTPUT_DELEGATING_RENDERER_H_