Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(588)

Unified Diff: cc/test/skia_common.cc

Issue 111143005: cc: Gather and lock/unlock SkDiscardablePixelRefs instead of skia::LazyPixelRefs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: cc/test/skia_common.cc
diff --git a/cc/test/skia_common.cc b/cc/test/skia_common.cc
index d8d61a85b9b1d4f8a6ee27acf486f5c1f2fe8417..de2733d77ded1d5bc48da57464cd3b4d2d50f994 100644
--- a/cc/test/skia_common.cc
+++ b/cc/test/skia_common.cc
@@ -31,33 +31,6 @@ SkPixelRef* TestPixelRef::deepCopy(
}
-TestLazyPixelRef::TestLazyPixelRef(const SkImageInfo& info)
- : skia::LazyPixelRef(info),
- pixels_(new char[4 * info.fWidth * info.fHeight]) {}
-
-TestLazyPixelRef::~TestLazyPixelRef() {}
-
-SkFlattenable::Factory TestLazyPixelRef::getFactory() const { return NULL; }
-
-void* TestLazyPixelRef::onLockPixels(SkColorTable** color_table) {
- return pixels_.get();
-}
-
-bool TestLazyPixelRef::PrepareToDecode(const PrepareParams& params) {
- return true;
-}
-
-bool TestLazyPixelRef::MaybeDecoded() {
- return true;
-}
-
-SkPixelRef* TestLazyPixelRef::deepCopy(
- SkBitmap::Config config,
- const SkIRect* subset) {
- this->ref();
- return this;
-}
-
void DrawPicture(unsigned char* buffer,
gfx::Rect layer_rect,
scoped_refptr<Picture> picture) {
@@ -80,12 +53,12 @@ void CreateBitmap(gfx::Size size, const char* uri, SkBitmap* bitmap) {
kPremul_SkAlphaType
};
- skia::RefPtr<TestLazyPixelRef> lazy_pixel_ref =
- skia::AdoptRef(new TestLazyPixelRef(info));
- lazy_pixel_ref->setURI(uri);
+ skia::RefPtr<TestPixelRef> pixel_ref =
+ skia::AdoptRef(new TestPixelRef(info));
+ pixel_ref->setURI(uri);
bitmap->setConfig(info);
- bitmap->setPixelRef(lazy_pixel_ref.get());
+ bitmap->setPixelRef(pixel_ref.get());
}

Powered by Google App Engine
This is Rietveld 408576698