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

Side by Side Diff: cc/renderer.h

Issue 11122003: [cc] Rename all cc/ filenames to Chromium style (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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 | « cc/render_surface_impl.cc ('k') | cc/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
5 #ifndef CCRenderer_h
6 #define CCRenderer_h
7
8 #include "base/basictypes.h"
9 #include "CCLayerTreeHost.h"
10 #include "CCRenderPass.h"
11 #include "FloatQuad.h"
12 #include "IntRect.h"
13 #include <wtf/PassRefPtr.h>
14
15 namespace cc {
16
17 class CCScopedTexture;
18
19 class CCRendererClient {
20 public:
21 virtual const IntSize& deviceViewportSize() const = 0;
22 virtual const CCLayerTreeSettings& settings() const = 0;
23 virtual void didLoseContext() = 0;
24 virtual void onSwapBuffersComplete() = 0;
25 virtual void releaseContentsTextures() = 0;
26 virtual void setFullRootLayerDamage() = 0;
27 virtual void setMemoryAllocationLimitBytes(size_t) = 0;
28 protected:
29 virtual ~CCRendererClient() { }
30 };
31
32 class CCRenderer {
33 public:
34 // This enum defines the various resource pools for the CCResourceProvider
35 // where textures get allocated.
36 enum ResourcePool {
37 ImplPool = 1, // This pool is for textures that get allocated on the impl thread (e.g. RenderSurfaces).
38 ContentPool // This pool is for textures that get allocated on the main th read (e.g. tiles).
39 };
40
41 virtual ~CCRenderer() { }
42
43 virtual const RendererCapabilities& capabilities() const = 0;
44
45 const CCLayerTreeSettings& settings() const { return m_client->settings(); }
46
47 const IntSize& viewportSize() { return m_client->deviceViewportSize(); }
48 int viewportWidth() { return viewportSize().width(); }
49 int viewportHeight() { return viewportSize().height(); }
50
51 virtual void viewportChanged() { }
52
53 virtual void decideRenderPassAllocationsForFrame(const CCRenderPassList&) { }
54 virtual bool haveCachedResourcesForRenderPassId(CCRenderPass::Id) const;
55
56 virtual void drawFrame(const CCRenderPassList&, const CCRenderPassIdHashMap& ) = 0;
57
58 // waits for rendering to finish
59 virtual void finish() = 0;
60
61 virtual void doNoOp() { }
62 // puts backbuffer onscreen
63 virtual bool swapBuffers() = 0;
64
65 virtual void getFramebufferPixels(void *pixels, const IntRect&) = 0;
66
67 virtual bool isContextLost();
68
69 virtual void setVisible(bool) = 0;
70
71 protected:
72 explicit CCRenderer(CCRendererClient* client)
73 : m_client(client)
74 {
75 }
76
77 CCRendererClient* m_client;
78
79 DISALLOW_COPY_AND_ASSIGN(CCRenderer);
80 };
81
82 }
83
84 #endif // CCRenderer_h
OLDNEW
« no previous file with comments | « cc/render_surface_impl.cc ('k') | cc/renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698