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

Unified Diff: tests/GpuBitmapCopyTest.cpp

Issue 168653002: Change device factories to take SkImageInfo instead of SkBitmap::Config (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: fix PdfViewer Created 6 years, 10 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 | « tests/CanvasStateTest.cpp ('k') | tests/ImageFilterTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/GpuBitmapCopyTest.cpp
diff --git a/tests/GpuBitmapCopyTest.cpp b/tests/GpuBitmapCopyTest.cpp
index fb81e2b74c70064fae2ee565bf885b30f79e1bee..08ceff23fbe27ecec604b6a84e12bae7f267574c 100644
--- a/tests/GpuBitmapCopyTest.cpp
+++ b/tests/GpuBitmapCopyTest.cpp
@@ -122,18 +122,32 @@ DEF_GPUTEST(GpuBitmapCopy, reporter, factory) {
return;
}
static const Pair gPairs[] = {
- { SkBitmap::kNo_Config, "00" },
- { SkBitmap::kARGB_8888_Config, "01" },
+ // SkGpuDevice can no longer be Create()ed with kNo_Config
+ // (or kUnknown_SkColorType in the new world), hence much of this
+ // test will be skipped, since it was checking that calling
+ // copyTo or deepCopyTo with src or dst set to kUnknown/kNo would
+ // successfully fail.
+ //
+ // If we can declare that you can *never* create a texture with
+ // kUnknown, then perhaps we can remove this entire test...
+ //
+// { SkBitmap::kNo_Config, "00" },
+// { SkBitmap::kARGB_8888_Config, "01" },
+ { SkBitmap::kARGB_8888_Config, "1" },
};
const int W = 20;
const int H = 33;
for (size_t i = 0; i < SK_ARRAY_COUNT(gPairs); i++) {
+ SkImageInfo info = SkImageInfo::Make(W, H,
+ SkBitmapConfigToColorType(gPairs[i].fConfig),
+ kPremul_SkAlphaType);
SkBitmap src, dst;
- SkGpuDevice* device = SkNEW_ARGS(SkGpuDevice, (grContext, gPairs[i].fConfig, W, H));
- SkAutoUnref aur(device);
+ SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(grContext, info, 0));
+ SkASSERT(device.get());
+
src = device->accessBitmap(false);
device->clear(SK_ColorWHITE);
« no previous file with comments | « tests/CanvasStateTest.cpp ('k') | tests/ImageFilterTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698