1 // Copyright 2011 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_BITMAP_SKPICTURE_CONTENT_LAYER_UPDATER_H_
6 #define CC_BITMAP_SKPICTURE_CONTENT_LAYER_UPDATER_H_
8 #include "cc/skpicture_content_layer_updater.h"
9 #include "third_party/skia/include/core/SkBitmap.h"
13 // This class records the contentRect into an SkPicture, then software rasterizes
14 // the SkPicture into bitmaps for each tile. This implements Settings::perTilePainting.
15 class BitmapSkPictureContentLayerUpdater
: public SkPictureContentLayerUpdater
{
17 class Resource
: public ContentLayerUpdater::Resource
{
19 Resource(BitmapSkPictureContentLayerUpdater
*, scoped_ptr
<PrioritizedResource
>);
21 virtual void update(ResourceUpdateQueue
&, const gfx::Rect
& sourceRect
, const gfx::Vector2d
& destOffset
, bool partialUpdate
, RenderingStats
&) OVERRIDE
;
24 BitmapSkPictureContentLayerUpdater
* updater() { return m_updater
; }
27 BitmapSkPictureContentLayerUpdater
* m_updater
;
30 static scoped_refptr
<BitmapSkPictureContentLayerUpdater
> create(scoped_ptr
<LayerPainter
>);
32 virtual scoped_ptr
<LayerUpdater::Resource
> createResource(PrioritizedResourceManager
*) OVERRIDE
;
33 void paintContentsRect(SkCanvas
*, const gfx::Rect
& sourceRect
, RenderingStats
&);
36 explicit BitmapSkPictureContentLayerUpdater(scoped_ptr
<LayerPainter
>);
37 virtual ~BitmapSkPictureContentLayerUpdater();
42 #endif // CC_BITMAP_SKPICTURE_CONTENT_LAYER_UPDATER_H_