Update mojo surfaces bindings and mojo/cc/ glue
[chromium-blink-merge.git] / cc / resources / skpicture_content_layer_updater.h
bloba567976a2d87da980a319df4de0da362ff45ccde
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_RESOURCES_SKPICTURE_CONTENT_LAYER_UPDATER_H_
6 #define CC_RESOURCES_SKPICTURE_CONTENT_LAYER_UPDATER_H_
8 #include "cc/resources/content_layer_updater.h"
9 #include "skia/ext/refptr.h"
10 #include "third_party/skia/include/core/SkPicture.h"
12 class SkCanvas;
14 namespace cc {
16 class LayerPainter;
18 // This class records the content_rect into an SkPicture. Subclass provides
19 // SkCanvas to DrawPicture() for tile updating based on this recorded picture.
20 class SkPictureContentLayerUpdater : public ContentLayerUpdater {
21 protected:
22 SkPictureContentLayerUpdater(
23 scoped_ptr<LayerPainter> painter,
24 RenderingStatsInstrumentation* stats_instrumentation,
25 int layer_id);
26 virtual ~SkPictureContentLayerUpdater();
28 virtual void PrepareToUpdate(const gfx::Rect& content_rect,
29 const gfx::Size& tile_size,
30 float contents_width_scale,
31 float contents_height_scale,
32 gfx::Rect* resulting_opaque_rect) OVERRIDE;
33 void DrawPicture(SkCanvas* canvas);
35 private:
36 skia::RefPtr<SkPicture> picture_;
38 DISALLOW_COPY_AND_ASSIGN(SkPictureContentLayerUpdater);
41 } // namespace cc
43 #endif // CC_RESOURCES_SKPICTURE_CONTENT_LAYER_UPDATER_H_