diff options
author | reveman@google.com <reveman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-25 17:48:07 +0000 |
---|---|---|
committer | reveman@google.com <reveman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-25 17:48:07 +0000 |
commit | 9dcd07a68e2e2208ac6455b37a6c1f760653b7e6 (patch) | |
tree | b71491414cb0fae068435cf15058945319930a70 /cc/bitmap_content_layer_updater.h | |
parent | a4ed76ec4efb2ea4e447b3ae3e70cf940cb8f333 (diff) | |
download | chromium_src-9dcd07a68e2e2208ac6455b37a6c1f760653b7e6.zip chromium_src-9dcd07a68e2e2208ac6455b37a6c1f760653b7e6.tar.gz chromium_src-9dcd07a68e2e2208ac6455b37a6c1f760653b7e6.tar.bz2 |
cc: Rename CanvasLayerUpdater to ContentLayerUpdater.
sed -e '
s/CanvasLayerUpdater/ContentLayerUpdater/g
s/canvas_layer_updater/content_layer_updater/g
'
BUG=
TEST=cc_unittests
Review URL: https://codereview.chromium.org/11271022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@164104 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/bitmap_content_layer_updater.h')
-rw-r--r-- | cc/bitmap_content_layer_updater.h | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/cc/bitmap_content_layer_updater.h b/cc/bitmap_content_layer_updater.h new file mode 100644 index 0000000..573bcac --- /dev/null +++ b/cc/bitmap_content_layer_updater.h @@ -0,0 +1,54 @@ +// Copyright 2011 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 BitmapContentLayerUpdater_h +#define BitmapContentLayerUpdater_h + +#include "cc/content_layer_updater.h" + +class SkCanvas; + +namespace cc { + +class LayerPainter; + +// This class rasterizes the contentRect into a skia bitmap canvas. It then updates +// textures by copying from the canvas into the texture, using MapSubImage if +// possible. +class BitmapContentLayerUpdater : public ContentLayerUpdater { +public: + class Resource : public LayerUpdater::Resource { + public: + Resource(BitmapContentLayerUpdater*, scoped_ptr<PrioritizedTexture>); + virtual ~Resource(); + + virtual void update(TextureUpdateQueue&, const IntRect& sourceRect, const IntSize& destOffset, bool partialUpdate, RenderingStats&) OVERRIDE; + + private: + BitmapContentLayerUpdater* updater() { return m_updater; } + + BitmapContentLayerUpdater* m_updater; + }; + + static scoped_refptr<BitmapContentLayerUpdater> create(scoped_ptr<LayerPainter>); + + virtual scoped_ptr<LayerUpdater::Resource> createResource(PrioritizedTextureManager*) OVERRIDE; + virtual void prepareToUpdate(const IntRect& contentRect, const IntSize& tileSize, float contentsWidthScale, float contentsHeightScale, IntRect& resultingOpaqueRect, RenderingStats&) OVERRIDE; + void updateTexture(TextureUpdateQueue&, PrioritizedTexture*, const IntRect& sourceRect, const IntSize& destOffset, bool partialUpdate); + + virtual void setOpaque(bool) OVERRIDE; + +protected: + explicit BitmapContentLayerUpdater(scoped_ptr<LayerPainter>); + virtual ~BitmapContentLayerUpdater(); + + scoped_ptr<SkCanvas> m_canvas; + IntSize m_canvasSize; + bool m_opaque; +}; + +} // namespace cc + +#endif // BitmapContentLayerUpdater_h |