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 "Test.h" | |
9 #include "SkBitmap.h" | 8 #include "SkBitmap.h" |
10 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
11 #include "SkColor.h" | 10 #include "SkColor.h" |
12 #include "SkColorFilter.h" | 11 #include "SkColorFilter.h" |
13 #include "SkGradientShader.h" | 12 #include "SkGradientShader.h" |
14 #include "SkPaint.h" | 13 #include "SkPaint.h" |
15 #include "SkPictureFlat.h" | 14 #include "SkPictureFlat.h" |
16 #include "SkShader.h" | 15 #include "SkShader.h" |
17 #include "SkXfermode.h" | 16 #include "SkXfermode.h" |
| 17 #include "Test.h" |
18 | 18 |
19 struct SkFlattenableTraits { | 19 struct SkFlattenableTraits { |
20 static void flatten(SkOrderedWriteBuffer& buffer, const SkFlattenable& flatt
enable) { | 20 static void flatten(SkOrderedWriteBuffer& buffer, const SkFlattenable& flatt
enable) { |
21 buffer.writeFlattenable(&flattenable); | 21 buffer.writeFlattenable(&flattenable); |
22 } | 22 } |
23 }; | 23 }; |
24 struct SkBitmapTraits { | 24 struct SkBitmapTraits { |
25 static void flatten(SkOrderedWriteBuffer& buffer, const SkBitmap& bitmap) { | 25 static void flatten(SkOrderedWriteBuffer& buffer, const SkBitmap& bitmap) { |
26 bitmap.flatten(buffer); | 26 bitmap.flatten(buffer); |
27 } | 27 } |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 } | 78 } |
79 | 79 |
80 // Test SkColorFilter | 80 // Test SkColorFilter |
81 SkAutoTUnref<SkColorFilter> cf(SkColorFilter::CreateLightingFilter(SK_ColorB
LUE, SK_ColorRED)); | 81 SkAutoTUnref<SkColorFilter> cf(SkColorFilter::CreateLightingFilter(SK_ColorB
LUE, SK_ColorRED)); |
82 testCreate<SkFlattenableTraits>(reporter, *cf); | 82 testCreate<SkFlattenableTraits>(reporter, *cf); |
83 | 83 |
84 // Test SkXfermode | 84 // Test SkXfermode |
85 SkAutoTUnref<SkXfermode> xfer(SkXfermode::Create(SkXfermode::kDstOver_Mode))
; | 85 SkAutoTUnref<SkXfermode> xfer(SkXfermode::Create(SkXfermode::kDstOver_Mode))
; |
86 testCreate<SkFlattenableTraits>(reporter, *xfer); | 86 testCreate<SkFlattenableTraits>(reporter, *xfer); |
87 } | 87 } |
OLD | NEW |