diff options
author | enne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-12 22:43:41 +0000 |
---|---|---|
committer | enne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-12 22:43:41 +0000 |
commit | cd57cc5a246367c2558fefa04ae9eca8f4d545d2 (patch) | |
tree | a2235045e9c5e4ff028d641b76f5d01aa5461b26 /cc/renderer.h | |
parent | 3fe7ba055be580443445895c0ee01ada3b628487 (diff) | |
download | chromium_src-cd57cc5a246367c2558fefa04ae9eca8f4d545d2.zip chromium_src-cd57cc5a246367c2558fefa04ae9eca8f4d545d2.tar.gz chromium_src-cd57cc5a246367c2558fefa04ae9eca8f4d545d2.tar.bz2 |
[cc] Rename all cc/ filenames to Chromium style
BUG=155413
Review URL: https://codereview.chromium.org/11122003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@161671 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/renderer.h')
-rw-r--r-- | cc/renderer.h | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/cc/renderer.h b/cc/renderer.h index 638cbb2..740ba0b 100644 --- a/cc/renderer.h +++ b/cc/renderer.h @@ -1,3 +1,84 @@ // Copyright 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. + +#ifndef CCRenderer_h +#define CCRenderer_h + +#include "base/basictypes.h" +#include "CCLayerTreeHost.h" +#include "CCRenderPass.h" +#include "FloatQuad.h" +#include "IntRect.h" +#include <wtf/PassRefPtr.h> + +namespace cc { + +class CCScopedTexture; + +class CCRendererClient { +public: + virtual const IntSize& deviceViewportSize() const = 0; + virtual const CCLayerTreeSettings& settings() const = 0; + virtual void didLoseContext() = 0; + virtual void onSwapBuffersComplete() = 0; + virtual void releaseContentsTextures() = 0; + virtual void setFullRootLayerDamage() = 0; + virtual void setMemoryAllocationLimitBytes(size_t) = 0; +protected: + virtual ~CCRendererClient() { } +}; + +class CCRenderer { +public: + // This enum defines the various resource pools for the CCResourceProvider + // where textures get allocated. + enum ResourcePool { + ImplPool = 1, // This pool is for textures that get allocated on the impl thread (e.g. RenderSurfaces). + ContentPool // This pool is for textures that get allocated on the main thread (e.g. tiles). + }; + + virtual ~CCRenderer() { } + + virtual const RendererCapabilities& capabilities() const = 0; + + const CCLayerTreeSettings& settings() const { return m_client->settings(); } + + const IntSize& viewportSize() { return m_client->deviceViewportSize(); } + int viewportWidth() { return viewportSize().width(); } + int viewportHeight() { return viewportSize().height(); } + + virtual void viewportChanged() { } + + virtual void decideRenderPassAllocationsForFrame(const CCRenderPassList&) { } + virtual bool haveCachedResourcesForRenderPassId(CCRenderPass::Id) const; + + virtual void drawFrame(const CCRenderPassList&, const CCRenderPassIdHashMap&) = 0; + + // waits for rendering to finish + virtual void finish() = 0; + + virtual void doNoOp() { } + // puts backbuffer onscreen + virtual bool swapBuffers() = 0; + + virtual void getFramebufferPixels(void *pixels, const IntRect&) = 0; + + virtual bool isContextLost(); + + virtual void setVisible(bool) = 0; + +protected: + explicit CCRenderer(CCRendererClient* client) + : m_client(client) + { + } + + CCRendererClient* m_client; + + DISALLOW_COPY_AND_ASSIGN(CCRenderer); +}; + +} + +#endif // CCRenderer_h |