diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-12-06 18:41:33 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-12-06 18:41:33 +0000 |
commit | 3e89524e747b513986abfeeea00b6fac79593f26 (patch) | |
tree | 2ccdbfb082b488e8a60749a07d778d9f82fac33c /tests/DrawBitmapRectTest.cpp | |
parent | 332999eabf8738d3b34e91b4a2e92daf5c7d7573 (diff) |
PixelRef now returns (nearly) everything that is currently in SkBitmap. The goal is to refactor bitmap later to remove redundancy, and more interestingly, remove the chance for a disconnect between the actual (pixelref) rowbytes and config, and the one claimed by the bitmap.
R=mtklein@google.com, scroggo@google.com
Review URL: https://codereview.chromium.org/68973005
git-svn-id: http://skia.googlecode.com/svn/trunk@12537 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'tests/DrawBitmapRectTest.cpp')
-rw-r--r-- | tests/DrawBitmapRectTest.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/DrawBitmapRectTest.cpp b/tests/DrawBitmapRectTest.cpp index 9289e11ea8..7049c0c299 100644 --- a/tests/DrawBitmapRectTest.cpp +++ b/tests/DrawBitmapRectTest.cpp @@ -44,12 +44,19 @@ public: // Crashing in skia when a pixelref fails in lockPixels // static void test_faulty_pixelref(skiatest::Reporter* reporter) { + SkImageInfo info; + info.fWidth = 100; + info.fHeight = 100; + info.fColorType = kPMColor_SkColorType; + info.fAlphaType = kPremul_SkAlphaType; + // need a cache, but don't expect to use it, so the budget is not critical SkAutoTUnref<SkDiscardableMemoryPool> pool(SkNEW_ARGS(SkDiscardableMemoryPool, (10 * 1000, NULL))); SkBitmap bm; bool installSuccess = SkDiscardablePixelRef::Install(SkNEW(FailureImageGenerator), &bm, pool); REPORTER_ASSERT(reporter, installSuccess); + // now our bitmap has a pixelref, but we know it will fail to lock SkAutoTUnref<SkSurface> surface(SkSurface::NewRasterPMColor(200, 200)); |