blob: 3a70dd3c0327011f070371fd425dc4fcb42c682c (
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
40
41
42
43
44
45
46
47
48
49
50
|
// 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 ImageLayerUpdater_h
#define ImageLayerUpdater_h
#include "config.h"
#include "cc/layer_updater.h"
namespace cc {
class ResourceUpdateQueue;
class ImageLayerUpdater : public LayerUpdater {
public:
class Resource : public LayerUpdater::Resource {
public:
Resource(ImageLayerUpdater* updater, scoped_ptr<PrioritizedResource> texture)
: LayerUpdater::Resource(texture.Pass())
, m_updater(updater)
{
}
virtual void update(ResourceUpdateQueue&, const gfx::Rect& sourceRect, const gfx::Vector2d& destOffset, bool partialUpdate, RenderingStats&) OVERRIDE;
private:
ImageLayerUpdater* m_updater;
};
static scoped_refptr<ImageLayerUpdater> create();
virtual scoped_ptr<LayerUpdater::Resource> createResource(
PrioritizedResourceManager*) OVERRIDE;
void updateTexture(ResourceUpdateQueue&, PrioritizedResource*, const gfx::Rect& sourceRect, const gfx::Vector2d& destOffset, bool partialUpdate);
void setBitmap(const SkBitmap&);
private:
ImageLayerUpdater() { }
virtual ~ImageLayerUpdater() { }
SkBitmap m_bitmap;
};
}
#endif
|