[cc] Cleanup: remove unused class - CachingBitmapContentLayerUpdater

No one uses this class.

R=enne@chromium.org
BUG=NONE
TEST=NONE(No functional change)

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@243509 0039d316-1c4b-4281-b951-d872f2087c98
parent 8e24fdf5
......@@ -302,8 +302,6 @@
'resources/bitmap_content_layer_updater.h',
'resources/bitmap_skpicture_content_layer_updater.cc',
'resources/bitmap_skpicture_content_layer_updater.h',
'resources/caching_bitmap_content_layer_updater.cc',
'resources/caching_bitmap_content_layer_updater.h',
'resources/content_layer_updater.cc',
'resources/content_layer_updater.h',
'resources/etc1_pixel_ref.cc',
......
// 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.
#include "cc/resources/caching_bitmap_content_layer_updater.h"
#include "base/logging.h"
#include "cc/resources/layer_painter.h"
#include "skia/ext/platform_canvas.h"
namespace cc {
scoped_refptr<CachingBitmapContentLayerUpdater>
CachingBitmapContentLayerUpdater::Create(
scoped_ptr<LayerPainter> painter,
RenderingStatsInstrumentation* stats_instrumentation,
int layer_id) {
return make_scoped_refptr(
new CachingBitmapContentLayerUpdater(painter.Pass(),
stats_instrumentation,
layer_id));
}
CachingBitmapContentLayerUpdater::CachingBitmapContentLayerUpdater(
scoped_ptr<LayerPainter> painter,
RenderingStatsInstrumentation* stats_instrumentation,
int layer_id)
: BitmapContentLayerUpdater(painter.Pass(),
stats_instrumentation,
layer_id),
pixels_did_change_(false) {}
CachingBitmapContentLayerUpdater::~CachingBitmapContentLayerUpdater() {}
void CachingBitmapContentLayerUpdater::PrepareToUpdate(
gfx::Rect content_rect,
gfx::Size tile_size,
float contents_width_scale,
float contents_height_scale,
gfx::Rect* resulting_opaque_rect) {
BitmapContentLayerUpdater::PrepareToUpdate(content_rect,
tile_size,
contents_width_scale,
contents_height_scale,
resulting_opaque_rect);
const SkBitmap& new_bitmap = canvas_->getDevice()->accessBitmap(false);
SkAutoLockPixels lock(new_bitmap);
DCHECK_GT(new_bitmap.bytesPerPixel(), 0);
pixels_did_change_ = new_bitmap.config() != cached_bitmap_.config() ||
new_bitmap.height() != cached_bitmap_.height() ||
new_bitmap.width() != cached_bitmap_.width() ||
memcmp(new_bitmap.getPixels(),
cached_bitmap_.getPixels(),
new_bitmap.getSafeSize());
if (pixels_did_change_)
new_bitmap.deepCopyTo(&cached_bitmap_, new_bitmap.config());
}
} // namespace cc
// 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 CC_RESOURCES_CACHING_BITMAP_CONTENT_LAYER_UPDATER_H_
#define CC_RESOURCES_CACHING_BITMAP_CONTENT_LAYER_UPDATER_H_
#include "base/compiler_specific.h"
#include "cc/resources/bitmap_content_layer_updater.h"
#include "third_party/skia/include/core/SkBitmap.h"
namespace cc {
class CachingBitmapContentLayerUpdater : public BitmapContentLayerUpdater {
public:
static scoped_refptr<CachingBitmapContentLayerUpdater> Create(
scoped_ptr<LayerPainter>,
RenderingStatsInstrumentation* stats_instrumentation,
int layer_id);
virtual void PrepareToUpdate(gfx::Rect content_rect,
gfx::Size tile_size,
float contents_width_scale,
float contents_height_scale,
gfx::Rect* resulting_opaque_rect) OVERRIDE;
bool pixels_did_change() const {
return pixels_did_change_;
}
private:
CachingBitmapContentLayerUpdater(
scoped_ptr<LayerPainter> painter,
RenderingStatsInstrumentation* stats_instrumentation,
int layer_id);
virtual ~CachingBitmapContentLayerUpdater();
bool pixels_did_change_;
SkBitmap cached_bitmap_;
DISALLOW_COPY_AND_ASSIGN(CachingBitmapContentLayerUpdater);
};
} // namespace cc
#endif // CC_RESOURCES_CACHING_BITMAP_CONTENT_LAYER_UPDATER_H_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment