OLD | NEW |
| (Empty) |
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. | |
4 | |
5 #ifndef CC_DELEGATING_RENDERER_H_ | |
6 #define CC_DELEGATING_RENDERER_H_ | |
7 | |
8 #include "base/memory/scoped_ptr.h" | |
9 #include "cc/base/cc_export.h" | |
10 #include "cc/renderer.h" | |
11 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3
D.h" | |
12 | |
13 namespace cc { | |
14 | |
15 class OutputSurface; | |
16 class ResourceProvider; | |
17 | |
18 class CC_EXPORT DelegatingRenderer : | |
19 public Renderer, | |
20 public NON_EXPORTED_BASE( | |
21 WebKit::WebGraphicsContext3D::WebGraphicsContextLostCallback) | |
22 { | |
23 public: | |
24 static scoped_ptr<DelegatingRenderer> Create( | |
25 RendererClient* client, | |
26 OutputSurface* output_surface, | |
27 ResourceProvider* resource_provider); | |
28 virtual ~DelegatingRenderer(); | |
29 | |
30 virtual const RendererCapabilities& Capabilities() const OVERRIDE; | |
31 | |
32 virtual void DrawFrame(RenderPassList& render_passes_in_draw_order) OVERRIDE; | |
33 | |
34 virtual void Finish() OVERRIDE {} | |
35 | |
36 virtual bool SwapBuffers() OVERRIDE; | |
37 | |
38 virtual void GetFramebufferPixels(void* pixels, gfx::Rect rect) OVERRIDE; | |
39 | |
40 virtual void ReceiveCompositorFrameAck(const CompositorFrameAck&) OVERRIDE; | |
41 | |
42 virtual bool IsContextLost() OVERRIDE; | |
43 | |
44 virtual void SetVisible(bool) OVERRIDE; | |
45 | |
46 virtual void SendManagedMemoryStats(size_t bytes_visible, | |
47 size_t bytes_visible_and_nearby, | |
48 size_t bytes_allocated) OVERRIDE {} | |
49 | |
50 // WebGraphicsContext3D::WebGraphicsContextLostCallback implementation. | |
51 virtual void onContextLost() OVERRIDE; | |
52 | |
53 private: | |
54 DelegatingRenderer(RendererClient* client, | |
55 OutputSurface* output_surface, | |
56 ResourceProvider* resource_provider); | |
57 bool Initialize(); | |
58 | |
59 OutputSurface* output_surface_; | |
60 ResourceProvider* resource_provider_; | |
61 RendererCapabilities capabilities_; | |
62 bool visible_; | |
63 | |
64 DISALLOW_COPY_AND_ASSIGN(DelegatingRenderer); | |
65 }; | |
66 | |
67 } // namespace cc | |
68 | |
69 #endif // CC_DELEGATING_RENDERER_H_ | |
OLD | NEW |