Use expanded heuristics for GPU rasterization on future OS versions
[chromium-blink-merge.git] / cc / resources / image_layer_updater.h
blobb2235b180312d88960e00b9f08b27f7ddf8adb25
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_RESOURCES_IMAGE_LAYER_UPDATER_H_
6 #define CC_RESOURCES_IMAGE_LAYER_UPDATER_H_
8 #include "cc/base/cc_export.h"
9 #include "cc/resources/layer_updater.h"
10 #include "third_party/skia/include/core/SkBitmap.h"
12 namespace cc {
14 class ResourceUpdateQueue;
16 class CC_EXPORT ImageLayerUpdater : public LayerUpdater {
17 public:
18 class Resource : public LayerUpdater::Resource {
19 public:
20 Resource(ImageLayerUpdater* updater,
21 scoped_ptr<PrioritizedResource> texture);
22 virtual ~Resource();
24 virtual void Update(ResourceUpdateQueue* queue,
25 const gfx::Rect& source_rect,
26 const gfx::Vector2d& dest_offset,
27 bool partial_update) OVERRIDE;
29 private:
30 ImageLayerUpdater* updater_;
32 DISALLOW_COPY_AND_ASSIGN(Resource);
35 static scoped_refptr<ImageLayerUpdater> Create();
37 virtual scoped_ptr<LayerUpdater::Resource> CreateResource(
38 PrioritizedResourceManager*) OVERRIDE;
40 void UpdateTexture(ResourceUpdateQueue* queue,
41 PrioritizedResource* texture,
42 const gfx::Rect& source_rect,
43 const gfx::Vector2d& dest_offset,
44 bool partial_update);
46 void SetBitmap(const SkBitmap& bitmap);
47 bool UsingBitmap(const SkBitmap& bitmap) const;
49 private:
50 ImageLayerUpdater() {}
51 virtual ~ImageLayerUpdater() {}
53 SkBitmap bitmap_;
55 DISALLOW_COPY_AND_ASSIGN(ImageLayerUpdater);
58 } // namespace cc
60 #endif // CC_RESOURCES_IMAGE_LAYER_UPDATER_H_