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