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
3 // found in the LICENSE file.
5 #ifndef CC_CACHING_BITMAP_CONTENT_LAYER_UPDATER_H_
6 #define CC_CACHING_BITMAP_CONTENT_LAYER_UPDATER_H_
8 #include "base/compiler_specific.h"
9 #include "cc/bitmap_content_layer_updater.h"
10 #include "third_party/skia/include/core/SkBitmap.h"
14 class CachingBitmapContentLayerUpdater
15 : public BitmapContentLayerUpdater
{
17 static scoped_refptr
<CachingBitmapContentLayerUpdater
> Create(
18 scoped_ptr
<LayerPainter
>);
20 virtual void prepareToUpdate(const gfx::Rect
& content_rect
,
21 const gfx::Size
& tile_size
,
22 float contents_width_scale
,
23 float contents_height_scale
,
24 gfx::Rect
& resulting_opaque_rect
,
25 RenderingStats
&) OVERRIDE
;
27 bool pixelsDidChange() const;
30 explicit CachingBitmapContentLayerUpdater(
31 scoped_ptr
<LayerPainter
> painter
);
32 virtual ~CachingBitmapContentLayerUpdater();
34 bool pixels_did_change_
;
35 SkBitmap cached_bitmap_
;
40 #endif // CC_CACHING_BITMAP_CONTENT_LAYER_UPDATER_H_