| Index: cc/test/skia_common.cc
|
| diff --git a/cc/test/skia_common.cc b/cc/test/skia_common.cc
|
| index e1336d295e494f8c6845e19e09cab74713cf14ef..a25df8d4ffb36d9523df5a4127e743a0e5b680ab 100644
|
| --- a/cc/test/skia_common.cc
|
| +++ b/cc/test/skia_common.cc
|
| @@ -8,11 +8,22 @@
|
| #include "cc/playback/picture.h"
|
| #include "skia/ext/refptr.h"
|
| #include "third_party/skia/include/core/SkCanvas.h"
|
| +#include "third_party/skia/include/core/SkImageGenerator.h"
|
| #include "ui/gfx/geometry/rect.h"
|
| #include "ui/gfx/skia_util.h"
|
|
|
| namespace cc {
|
|
|
| +namespace {
|
| +
|
| +class TestImageGenerator : public SkImageGenerator {
|
| + public:
|
| + explicit TestImageGenerator(const SkImageInfo& info)
|
| + : SkImageGenerator(info) {}
|
| +};
|
| +
|
| +} // anonymous namespace
|
| +
|
| void DrawPicture(unsigned char* buffer,
|
| const gfx::Rect& layer_rect,
|
| scoped_refptr<Picture> picture) {
|
| @@ -39,12 +50,10 @@ void DrawDisplayList(unsigned char* buffer,
|
| list->Raster(&canvas, NULL, gfx::Rect(), 1.0f);
|
| }
|
|
|
| -void CreateBitmap(const gfx::Size& size, const char* uri, SkBitmap* bitmap) {
|
| - SkImageInfo info = SkImageInfo::MakeN32Premul(size.width(), size.height());
|
| -
|
| - bitmap->allocPixels(info);
|
| - bitmap->pixelRef()->setImmutable();
|
| - bitmap->pixelRef()->setURI(uri);
|
| +void CreateDiscardableBitmap(const gfx::Size& size, SkBitmap* bitmap) {
|
| + const SkImageInfo info =
|
| + SkImageInfo::MakeN32Premul(size.width(), size.height());
|
| + SkInstallDiscardablePixelRef(new TestImageGenerator(info), bitmap);
|
| }
|
|
|
| } // namespace cc
|
|
|