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

Unified Diff: skia/ext/platform_canvas_unittest.cc

Issue 1396613006: Remove skia::PlatformBitmap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months 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
« no previous file with comments | « skia/ext/platform_canvas.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: skia/ext/platform_canvas_unittest.cc
diff --git a/skia/ext/platform_canvas_unittest.cc b/skia/ext/platform_canvas_unittest.cc
index 22a20a1aa33c6ecf74e1433b510215038a19a258..cb2862f9c4057057f7f7e78d7c81410ec1aaffb0 100644
--- a/skia/ext/platform_canvas_unittest.cc
+++ b/skia/ext/platform_canvas_unittest.cc
@@ -397,65 +397,4 @@ TEST(PlatformCanvas, TranslateLayer) {
#endif // #if !defined(USE_AURA)
-TEST(PlatformBitmapTest, PlatformBitmap) {
- const int kWidth = 400;
- const int kHeight = 300;
- scoped_ptr<PlatformBitmap> platform_bitmap(new PlatformBitmap);
-
- EXPECT_TRUE(0 == platform_bitmap->GetSurface());
- EXPECT_TRUE(platform_bitmap->GetBitmap().empty());
- EXPECT_TRUE(platform_bitmap->GetBitmap().isNull());
-
- EXPECT_TRUE(platform_bitmap->Allocate(kWidth, kHeight, /*is_opaque=*/false));
-
- EXPECT_TRUE(0 != platform_bitmap->GetSurface());
- EXPECT_FALSE(platform_bitmap->GetBitmap().empty());
- EXPECT_FALSE(platform_bitmap->GetBitmap().isNull());
- EXPECT_EQ(kWidth, platform_bitmap->GetBitmap().width());
- EXPECT_EQ(kHeight, platform_bitmap->GetBitmap().height());
- EXPECT_LE(static_cast<size_t>(platform_bitmap->GetBitmap().width()*4),
- platform_bitmap->GetBitmap().rowBytes());
- EXPECT_EQ(kN32_SkColorType, // Same for all platforms.
- platform_bitmap->GetBitmap().colorType());
- EXPECT_TRUE(platform_bitmap->GetBitmap().lockPixelsAreWritable());
-#if defined(SK_DEBUG)
- EXPECT_TRUE(platform_bitmap->GetBitmap().pixelRef()->isLocked());
-#endif
- EXPECT_TRUE(platform_bitmap->GetBitmap().pixelRef()->unique());
-
- *(platform_bitmap->GetBitmap().getAddr32(10, 20)) = 0xDEED1020;
- *(platform_bitmap->GetBitmap().getAddr32(20, 30)) = 0xDEED2030;
-
- SkBitmap sk_bitmap = platform_bitmap->GetBitmap();
- sk_bitmap.lockPixels();
-
- EXPECT_FALSE(platform_bitmap->GetBitmap().pixelRef()->unique());
- EXPECT_FALSE(sk_bitmap.pixelRef()->unique());
-
- EXPECT_EQ(0xDEED1020, *sk_bitmap.getAddr32(10, 20));
- EXPECT_EQ(0xDEED2030, *sk_bitmap.getAddr32(20, 30));
-
- *(platform_bitmap->GetBitmap().getAddr32(30, 40)) = 0xDEED3040;
-
- // The SkBitmaps derived from a PlatformBitmap must be capable of outliving
- // the PlatformBitmap.
- platform_bitmap.reset();
-
- EXPECT_TRUE(sk_bitmap.pixelRef()->unique());
-
- EXPECT_EQ(0xDEED1020, *sk_bitmap.getAddr32(10, 20));
- EXPECT_EQ(0xDEED2030, *sk_bitmap.getAddr32(20, 30));
- EXPECT_EQ(0xDEED3040, *sk_bitmap.getAddr32(30, 40));
- sk_bitmap.unlockPixels();
-
- EXPECT_EQ(NULL, sk_bitmap.getPixels());
-
- sk_bitmap.lockPixels();
- EXPECT_EQ(0xDEED1020, *sk_bitmap.getAddr32(10, 20));
- EXPECT_EQ(0xDEED2030, *sk_bitmap.getAddr32(20, 30));
- EXPECT_EQ(0xDEED3040, *sk_bitmap.getAddr32(30, 40));
- sk_bitmap.unlockPixels();
-}
-
-
} // namespace skia
« no previous file with comments | « skia/ext/platform_canvas.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698