summaryrefslogtreecommitdiffstats
path: root/cc/caching_bitmap_canvas_layer_texture_updater.h
blob: 036aaede052c4642ff43d19c90077dfab5a9a36a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// 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 CACHING_BITMAP_CANVAS_LAYER_TEXTURE_UPDATER_H_
#define CACHING_BITMAP_CANVAS_LAYER_TEXTURE_UPDATER_H_

#include "base/compiler_specific.h"
#include "BitmapCanvasLayerTextureUpdater.h"

namespace cc {

class CachingBitmapCanvasLayerTextureUpdater
    : public BitmapCanvasLayerTextureUpdater {
 public:
  static scoped_refptr<CachingBitmapCanvasLayerTextureUpdater> Create(
      scoped_ptr<LayerPainterChromium>);

  virtual void prepareToUpdate(const IntRect& content_rect,
                               const IntSize& tile_size,
                               float contents_width_scale,
                               float contents_height_scale,
                               IntRect& resulting_opaque_rect,
                               CCRenderingStats&) OVERRIDE;

  bool pixelsDidChange() const;

 private:
  explicit CachingBitmapCanvasLayerTextureUpdater(
      scoped_ptr<LayerPainterChromium> painter);
  virtual ~CachingBitmapCanvasLayerTextureUpdater();

  bool pixels_did_change_;
  SkBitmap cached_bitmap_;
};

}  // namespace cc

#endif  // CACHING_BITMAP_CANVAS_LAYER_TEXTURE_UPDATER_H_