Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(222)

Side by Side Diff: cc/output/delegating_renderer.h

Issue 12545018: Move context-related callbacks into OutputSurface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: unit test Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | cc/output/delegating_renderer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "cc/base/cc_export.h" 9 #include "cc/base/cc_export.h"
10 #include "cc/output/renderer.h" 10 #include "cc/output/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 public: 20 public:
23 static scoped_ptr<DelegatingRenderer> Create( 21 static scoped_ptr<DelegatingRenderer> Create(
24 RendererClient* client, 22 RendererClient* client,
25 OutputSurface* output_surface, 23 OutputSurface* output_surface,
26 ResourceProvider* resource_provider); 24 ResourceProvider* resource_provider);
27 virtual ~DelegatingRenderer(); 25 virtual ~DelegatingRenderer();
28 26
29 virtual const RendererCapabilities& Capabilities() const OVERRIDE; 27 virtual const RendererCapabilities& Capabilities() const OVERRIDE;
30 28
31 virtual void DrawFrame(RenderPassList* render_passes_in_draw_order) OVERRIDE; 29 virtual void DrawFrame(RenderPassList* render_passes_in_draw_order) OVERRIDE;
32 30
33 virtual void Finish() OVERRIDE {} 31 virtual void Finish() OVERRIDE {}
34 32
35 virtual bool SwapBuffers() OVERRIDE; 33 virtual bool SwapBuffers() OVERRIDE;
36 34
37 virtual void GetFramebufferPixels(void* pixels, gfx::Rect rect) OVERRIDE; 35 virtual void GetFramebufferPixels(void* pixels, gfx::Rect rect) OVERRIDE;
38 36
39 virtual void ReceiveCompositorFrameAck(const CompositorFrameAck&) OVERRIDE; 37 virtual void ReceiveCompositorFrameAck(const CompositorFrameAck&) OVERRIDE;
40 38
41 virtual bool IsContextLost() OVERRIDE; 39 virtual bool IsContextLost() OVERRIDE;
42 40
43 virtual void SetVisible(bool visible) OVERRIDE; 41 virtual void SetVisible(bool visible) OVERRIDE;
44 42
45 virtual void SendManagedMemoryStats(size_t bytes_visible, 43 virtual void SendManagedMemoryStats(size_t bytes_visible,
46 size_t bytes_visible_and_nearby, 44 size_t bytes_visible_and_nearby,
47 size_t bytes_allocated) OVERRIDE {} 45 size_t bytes_allocated) OVERRIDE {}
48 46
49 // WebGraphicsContext3D::WebGraphicsContextLostCallback implementation.
50 virtual void onContextLost() OVERRIDE;
51
52 private: 47 private:
53 DelegatingRenderer(RendererClient* client, 48 DelegatingRenderer(RendererClient* client,
54 OutputSurface* output_surface, 49 OutputSurface* output_surface,
55 ResourceProvider* resource_provider); 50 ResourceProvider* resource_provider);
56 bool Initialize(); 51 bool Initialize();
57 52
58 OutputSurface* output_surface_; 53 OutputSurface* output_surface_;
59 ResourceProvider* resource_provider_; 54 ResourceProvider* resource_provider_;
60 RendererCapabilities capabilities_; 55 RendererCapabilities capabilities_;
61 bool visible_; 56 bool visible_;
62 57
63 DISALLOW_COPY_AND_ASSIGN(DelegatingRenderer); 58 DISALLOW_COPY_AND_ASSIGN(DelegatingRenderer);
64 }; 59 };
65 60
66 } // namespace cc 61 } // namespace cc
67 62
68 #endif // CC_OUTPUT_DELEGATING_RENDERER_H_ 63 #endif // CC_OUTPUT_DELEGATING_RENDERER_H_
OLDNEW
« no previous file with comments | « no previous file | cc/output/delegating_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698