OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2014 Google Inc. | 3 * Copyright 2014 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 | 8 |
9 // This test only works with the GPU backend. | 9 // This test only works with the GPU backend. |
10 | 10 |
(...skipping 20 matching lines...) Expand all Loading... |
31 | 31 |
32 protected: | 32 protected: |
33 SkString onShortName() SK_OVERRIDE { | 33 SkString onShortName() SK_OVERRIDE { |
34 return SkString("yuv_to_rgb_effect"); | 34 return SkString("yuv_to_rgb_effect"); |
35 } | 35 } |
36 | 36 |
37 SkISize onISize() SK_OVERRIDE { | 37 SkISize onISize() SK_OVERRIDE { |
38 return SkISize::Make(334, 128); | 38 return SkISize::Make(334, 128); |
39 } | 39 } |
40 | 40 |
41 uint32_t onGetFlags() const SK_OVERRIDE { | |
42 // This is a GPU-specific GM. | |
43 return kGPUOnly_Flag; | |
44 } | |
45 | |
46 void onOnceBeforeDraw() SK_OVERRIDE { | 41 void onOnceBeforeDraw() SK_OVERRIDE { |
47 SkImageInfo info = SkImageInfo::MakeA8(24, 24); | 42 SkImageInfo info = SkImageInfo::MakeA8(24, 24); |
48 fBmp[0].allocPixels(info); | 43 fBmp[0].allocPixels(info); |
49 fBmp[1].allocPixels(info); | 44 fBmp[1].allocPixels(info); |
50 fBmp[2].allocPixels(info); | 45 fBmp[2].allocPixels(info); |
51 unsigned char* pixels[3]; | 46 unsigned char* pixels[3]; |
52 for (int i = 0; i < 3; ++i) { | 47 for (int i = 0; i < 3; ++i) { |
53 pixels[i] = (unsigned char*)fBmp[i].getPixels(); | 48 pixels[i] = (unsigned char*)fBmp[i].getPixels(); |
54 } | 49 } |
55 int color[] = {0, 85, 170}; | 50 int color[] = {0, 85, 170}; |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 private: | 124 private: |
130 SkBitmap fBmp[3]; | 125 SkBitmap fBmp[3]; |
131 | 126 |
132 typedef GM INHERITED; | 127 typedef GM INHERITED; |
133 }; | 128 }; |
134 | 129 |
135 DEF_GM( return SkNEW(YUVtoRGBEffect); ) | 130 DEF_GM( return SkNEW(YUVtoRGBEffect); ) |
136 } | 131 } |
137 | 132 |
138 #endif | 133 #endif |
OLD | NEW |