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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 const int indices[6][3] = {{0, 1, 2}, {0, 2, 1}, {1, 0, 2}, | 113 const int indices[6][3] = {{0, 1, 2}, {0, 2, 1}, {1, 0, 2}, |
114 {1, 2, 0}, {2, 0, 1}, {2, 1, 0}}; | 114 {1, 2, 0}, {2, 0, 1}, {2, 1, 0}}; |
115 | 115 |
116 for (int i = 0; i < 6; ++i) { | 116 for (int i = 0; i < 6; ++i) { |
117 GrPipelineBuilder pipelineBuilder; | 117 GrPipelineBuilder pipelineBuilder; |
118 SkAutoTUnref<GrFragmentProcessor> fp( | 118 SkAutoTUnref<GrFragmentProcessor> fp( |
119 GrYUVtoRGBEffect::Create(texture[indices[i][0]], | 119 GrYUVtoRGBEffect::Create(texture[indices[i][0]], |
120 texture[indices[i][1]], | 120 texture[indices[i][1]], |
121 texture[indices[i][2]], | 121 texture[indices[i][2]], |
122 sizes, | 122 sizes, |
123 static_cast<SkYUVColorSpace
>(space))); | 123 static_cast<SkYUVColorSpace
>(space), rt)); |
124 if (fp) { | 124 if (fp) { |
125 SkMatrix viewMatrix; | 125 SkMatrix viewMatrix; |
126 viewMatrix.setTranslate(x, y); | 126 viewMatrix.setTranslate(x, y); |
127 pipelineBuilder.setRenderTarget(rt); | 127 pipelineBuilder.setRenderTarget(rt); |
128 pipelineBuilder.addColorFragmentProcessor(fp); | 128 pipelineBuilder.addColorFragmentProcessor(fp); |
129 tt.target()->drawNonAARect(pipelineBuilder, | 129 tt.target()->drawNonAARect(pipelineBuilder, |
130 GrColor_WHITE, | 130 GrColor_WHITE, |
131 viewMatrix, | 131 viewMatrix, |
132 renderRect); | 132 renderRect); |
133 } | 133 } |
134 x += renderRect.width() + kTestPad; | 134 x += renderRect.width() + kTestPad; |
135 } | 135 } |
136 } | 136 } |
137 } | 137 } |
138 | 138 |
139 private: | 139 private: |
140 SkBitmap fBmp[3]; | 140 SkBitmap fBmp[3]; |
141 | 141 |
142 typedef GM INHERITED; | 142 typedef GM INHERITED; |
143 }; | 143 }; |
144 | 144 |
145 DEF_GM(return new YUVtoRGBEffect;) | 145 //DEF_GM(return new YUVtoRGBEffect;) |
146 } | 146 } |
147 | 147 |
148 #endif | 148 #endif |
OLD | NEW |