Skip to content

Commit

Permalink
cc: Rename LayerTextureUpdater to LayerUpdater.
Browse files Browse the repository at this point in the history
sed -e '
s/TextureUpdater/Updater/g
s/textureUpdater/updater/g
s/texture_updater\.h/updater.h/g
s/texture_updater\.cc/updater.cc/g
s/TEXTURE_UPDATER_H_/UPDATER_H_/g
'

BUG=
TEST=cc_unittests

Review URL: https://codereview.chromium.org/11231082

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@163615 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
reveman@google.com committed Oct 23, 2012
1 parent 589029c commit 64d8d39
Show file tree
Hide file tree
Showing 29 changed files with 530 additions and 530 deletions.
84 changes: 0 additions & 84 deletions cc/bitmap_canvas_layer_texture_updater.cc

This file was deleted.

84 changes: 84 additions & 0 deletions cc/bitmap_canvas_layer_updater.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
// 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.

#include "config.h"

#include "cc/bitmap_canvas_layer_updater.h"

#include "cc/layer_painter.h"
#include "cc/resource_update.h"
#include "cc/texture_update_queue.h"
#include "skia/ext/platform_canvas.h"

namespace cc {

BitmapCanvasLayerUpdater::Texture::Texture(BitmapCanvasLayerUpdater* updater, scoped_ptr<PrioritizedTexture> texture)
: LayerUpdater::Texture(texture.Pass())
, m_updater(updater)
{
}

BitmapCanvasLayerUpdater::Texture::~Texture()
{
}

void BitmapCanvasLayerUpdater::Texture::update(TextureUpdateQueue& queue, const IntRect& sourceRect, const IntSize& destOffset, bool partialUpdate, RenderingStats&)
{
updater()->updateTexture(queue, texture(), sourceRect, destOffset, partialUpdate);
}

scoped_refptr<BitmapCanvasLayerUpdater> BitmapCanvasLayerUpdater::create(scoped_ptr<LayerPainter> painter)
{
return make_scoped_refptr(new BitmapCanvasLayerUpdater(painter.Pass()));
}

BitmapCanvasLayerUpdater::BitmapCanvasLayerUpdater(scoped_ptr<LayerPainter> painter)
: CanvasLayerUpdater(painter.Pass())
, m_opaque(false)
{
}

BitmapCanvasLayerUpdater::~BitmapCanvasLayerUpdater()
{
}

scoped_ptr<LayerUpdater::Texture> BitmapCanvasLayerUpdater::createTexture(PrioritizedTextureManager* manager)
{
return scoped_ptr<LayerUpdater::Texture>(new Texture(this, PrioritizedTexture::create(manager)));
}

void BitmapCanvasLayerUpdater::prepareToUpdate(const IntRect& contentRect, const IntSize& tileSize, float contentsWidthScale, float contentsHeightScale, IntRect& resultingOpaqueRect, RenderingStats& stats)
{
if (m_canvasSize != contentRect.size()) {
m_canvasSize = contentRect.size();
m_canvas = make_scoped_ptr(skia::CreateBitmapCanvas(m_canvasSize.width(), m_canvasSize.height(), m_opaque));
}

paintContents(m_canvas.get(), contentRect, contentsWidthScale, contentsHeightScale, resultingOpaqueRect, stats);
}

void BitmapCanvasLayerUpdater::updateTexture(TextureUpdateQueue& queue, PrioritizedTexture* texture, const IntRect& sourceRect, const IntSize& destOffset, bool partialUpdate)
{
ResourceUpdate upload = ResourceUpdate::Create(
texture,
&m_canvas->getDevice()->accessBitmap(false),
contentRect(),
sourceRect,
destOffset);
if (partialUpdate)
queue.appendPartialUpload(upload);
else
queue.appendFullUpload(upload);
}

void BitmapCanvasLayerUpdater::setOpaque(bool opaque)
{
if (opaque != m_opaque) {
m_canvas.reset();
m_canvasSize = IntSize();
}
m_opaque = opaque;
}

} // namespace cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
// found in the LICENSE file.


#ifndef BitmapCanvasLayerTextureUpdater_h
#define BitmapCanvasLayerTextureUpdater_h
#ifndef BitmapCanvasLayerUpdater_h
#define BitmapCanvasLayerUpdater_h

#include "cc/canvas_layer_texture_updater.h"
#include "cc/canvas_layer_updater.h"

class SkCanvas;

Expand All @@ -17,32 +17,32 @@ 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 BitmapCanvasLayerTextureUpdater : public CanvasLayerTextureUpdater {
class BitmapCanvasLayerUpdater : public CanvasLayerUpdater {
public:
class Texture : public LayerTextureUpdater::Texture {
class Texture : public LayerUpdater::Texture {
public:
Texture(BitmapCanvasLayerTextureUpdater*, scoped_ptr<PrioritizedTexture>);
Texture(BitmapCanvasLayerUpdater*, scoped_ptr<PrioritizedTexture>);
virtual ~Texture();

virtual void update(TextureUpdateQueue&, const IntRect& sourceRect, const IntSize& destOffset, bool partialUpdate, RenderingStats&) OVERRIDE;

private:
BitmapCanvasLayerTextureUpdater* textureUpdater() { return m_textureUpdater; }
BitmapCanvasLayerUpdater* updater() { return m_updater; }

BitmapCanvasLayerTextureUpdater* m_textureUpdater;
BitmapCanvasLayerUpdater* m_updater;
};

static scoped_refptr<BitmapCanvasLayerTextureUpdater> create(scoped_ptr<LayerPainter>);
static scoped_refptr<BitmapCanvasLayerUpdater> create(scoped_ptr<LayerPainter>);

virtual scoped_ptr<LayerTextureUpdater::Texture> createTexture(PrioritizedTextureManager*) OVERRIDE;
virtual scoped_ptr<LayerUpdater::Texture> createTexture(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 BitmapCanvasLayerTextureUpdater(scoped_ptr<LayerPainter>);
virtual ~BitmapCanvasLayerTextureUpdater();
explicit BitmapCanvasLayerUpdater(scoped_ptr<LayerPainter>);
virtual ~BitmapCanvasLayerUpdater();

scoped_ptr<SkCanvas> m_canvas;
IntSize m_canvasSize;
Expand All @@ -51,4 +51,4 @@ class BitmapCanvasLayerTextureUpdater : public CanvasLayerTextureUpdater {

} // namespace cc

#endif // BitmapCanvasLayerTextureUpdater_h
#endif // BitmapCanvasLayerUpdater_h
72 changes: 0 additions & 72 deletions cc/bitmap_skpicture_canvas_layer_texture_updater.cc

This file was deleted.

42 changes: 0 additions & 42 deletions cc/bitmap_skpicture_canvas_layer_texture_updater.h

This file was deleted.

Loading

0 comments on commit 64d8d39

Please sign in to comment.