OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 #include "Test.h" | 8 #include "Test.h" |
9 #include "SkBitmap.h" | 9 #include "SkBitmap.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
11 #include "SkData.h" | 11 #include "SkData.h" |
12 #include "SkPaint.h" | 12 #include "SkPaint.h" |
13 #include "SkShader.h" | 13 #include "SkShader.h" |
14 #include "SkSurface.h" | 14 #include "SkSurface.h" |
15 #include "SkRandom.h" | 15 #include "SkRandom.h" |
16 #include "SkMatrixUtils.h" | 16 #include "SkMatrixUtils.h" |
17 | 17 |
18 #include "SkLazyPixelRef.h" | 18 #include "SkLazyPixelRef.h" |
19 #include "SkLruImageCache.h" | 19 #include "SkLruImageCache.h" |
20 | 20 |
21 // A BitmapFactory that always fails when asked to return pixels. | 21 // A BitmapFactory that always fails when asked to return pixels. |
22 static bool FailureDecoder(const void* data, size_t length, SkImage::Info* info, | 22 static bool FailureDecoder(const void* data, size_t length, SkImageInfo* info, |
23 const SkBitmapFactory::Target* target) { | 23 const SkBitmapFactory::Target* target) { |
24 if (info) { | 24 if (info) { |
25 info->fWidth = info->fHeight = 100; | 25 info->fWidth = info->fHeight = 100; |
26 info->fColorType = SkImage::kRGBA_8888_ColorType; | 26 info->fColorType = kRGBA_8888_SkColorType; |
27 info->fAlphaType = kPremul_SkAlphaType; | 27 info->fAlphaType = kPremul_SkAlphaType; |
28 } | 28 } |
29 // this will deliberately return false if they are asking us to decode | 29 // this will deliberately return false if they are asking us to decode |
30 // into pixels. | 30 // into pixels. |
31 return NULL == target; | 31 return NULL == target; |
32 } | 32 } |
33 | 33 |
34 // crbug.com/295895 | 34 // crbug.com/295895 |
35 // Crashing in skia when a pixelref fails in lockPixels | 35 // Crashing in skia when a pixelref fails in lockPixels |
36 // | 36 // |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 | 320 |
321 test_nan_antihair(); | 321 test_nan_antihair(); |
322 test_giantrepeat_crbug118018(reporter); | 322 test_giantrepeat_crbug118018(reporter); |
323 | 323 |
324 test_treatAsSprite(reporter); | 324 test_treatAsSprite(reporter); |
325 test_faulty_pixelref(reporter); | 325 test_faulty_pixelref(reporter); |
326 } | 326 } |
327 | 327 |
328 #include "TestClassDef.h" | 328 #include "TestClassDef.h" |
329 DEFINE_TESTCLASS("DrawBitmapRect", TestDrawBitmapRectClass, TestDrawBitmapRect) | 329 DEFINE_TESTCLASS("DrawBitmapRect", TestDrawBitmapRectClass, TestDrawBitmapRect) |
OLD | NEW |