blob: bedc6ce0baf841a6bcb24346ccce778ae54a9cd9 (
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
51
52
53
54
55
56
57
58
59
60
61
|
// Copyright 2013 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 CC_TEST_FAKE_PICTURE_PILE_IMPL_H_
#define CC_TEST_FAKE_PICTURE_PILE_IMPL_H_
#include "base/memory/ref_counted.h"
#include "cc/resources/picture_pile_impl.h"
#include "cc/test/fake_content_layer_client.h"
namespace cc {
class FakePicturePileImpl : public PicturePileImpl {
public:
static scoped_refptr<FakePicturePileImpl> CreateFilledPile(
gfx::Size tile_size,
gfx::Size layer_bounds);
static scoped_refptr<FakePicturePileImpl> CreateEmptyPile(
gfx::Size tile_size,
gfx::Size layer_bounds);
TilingData& tiling() { return tiling_; }
void AddRecordingAt(int x, int y);
void RemoveRecordingAt(int x, int y);
void RerecordPile();
void AddPictureToRecording(
int x,
int y,
scoped_refptr<Picture> picture);
void add_draw_rect(const gfx::RectF& rect) {
client_.add_draw_rect(rect, default_paint_);
}
void add_draw_bitmap(const SkBitmap& bitmap, gfx::Point point) {
client_.add_draw_bitmap(bitmap, point);
}
void add_draw_rect_with_paint(const gfx::RectF& rect, const SkPaint& paint) {
client_.add_draw_rect(rect, paint);
}
void set_default_paint(const SkPaint& paint) {
default_paint_ = paint;
}
protected:
FakePicturePileImpl();
virtual ~FakePicturePileImpl();
FakeContentLayerClient client_;
SkPaint default_paint_;
};
} // namespace cc
#endif // CC_TEST_FAKE_PICTURE_PILE_IMPL_H_
|