OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "SkBitmap.h" | 8 #include "SkBitmap.h" |
9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkColor.h" | 10 #include "SkColor.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 colors[0] = SK_ColorRED; | 61 colors[0] = SK_ColorRED; |
62 colors[1] = SK_ColorBLUE; | 62 colors[1] = SK_ColorBLUE; |
63 | 63 |
64 SkAutoTUnref<SkShader> shader(SkGradientShader::CreateLinear(points, colors,
NULL, 2, | 64 SkAutoTUnref<SkShader> shader(SkGradientShader::CreateLinear(points, colors,
NULL, 2, |
65 SkShader::kRepe
at_TileMode)); | 65 SkShader::kRepe
at_TileMode)); |
66 testCreate<SkFlattenableTraits>(reporter, *shader); | 66 testCreate<SkFlattenableTraits>(reporter, *shader); |
67 | 67 |
68 // Test SkBitmap | 68 // Test SkBitmap |
69 { | 69 { |
70 SkBitmap bm; | 70 SkBitmap bm; |
71 bm.setConfig(SkBitmap::kARGB_8888_Config, 50, 50); | 71 bm.allocN32Pixels(50, 50); |
72 bm.allocPixels(); | |
73 SkCanvas canvas(bm); | 72 SkCanvas canvas(bm); |
74 SkPaint paint; | 73 SkPaint paint; |
75 paint.setShader(shader); | 74 paint.setShader(shader); |
76 canvas.drawPaint(paint); | 75 canvas.drawPaint(paint); |
77 testCreate<SkBitmapTraits>(reporter, bm); | 76 testCreate<SkBitmapTraits>(reporter, bm); |
78 } | 77 } |
79 | 78 |
80 // Test SkColorFilter | 79 // Test SkColorFilter |
81 SkAutoTUnref<SkColorFilter> cf(SkColorFilter::CreateLightingFilter(SK_ColorB
LUE, SK_ColorRED)); | 80 SkAutoTUnref<SkColorFilter> cf(SkColorFilter::CreateLightingFilter(SK_ColorB
LUE, SK_ColorRED)); |
82 testCreate<SkFlattenableTraits>(reporter, *cf); | 81 testCreate<SkFlattenableTraits>(reporter, *cf); |
83 | 82 |
84 // Test SkXfermode | 83 // Test SkXfermode |
85 SkAutoTUnref<SkXfermode> xfer(SkXfermode::Create(SkXfermode::kDstOver_Mode))
; | 84 SkAutoTUnref<SkXfermode> xfer(SkXfermode::Create(SkXfermode::kDstOver_Mode))
; |
86 testCreate<SkFlattenableTraits>(reporter, *xfer); | 85 testCreate<SkFlattenableTraits>(reporter, *xfer); |
87 } | 86 } |
OLD | NEW |