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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 SkIntToScalar(fBmp[0].height())); | 104 SkIntToScalar(fBmp[0].height())); |
105 renderRect.outset(kDrawPad, kDrawPad); | 105 renderRect.outset(kDrawPad, kDrawPad); |
106 | 106 |
107 SkScalar y = kDrawPad + kTestPad + space * kColorSpaceOffset; | 107 SkScalar y = kDrawPad + kTestPad + space * kColorSpaceOffset; |
108 SkScalar x = kDrawPad + kTestPad; | 108 SkScalar x = kDrawPad + kTestPad; |
109 | 109 |
110 const int indices[6][3] = {{0, 1, 2}, {0, 2, 1}, {1, 0, 2}, | 110 const int indices[6][3] = {{0, 1, 2}, {0, 2, 1}, {1, 0, 2}, |
111 {1, 2, 0}, {2, 0, 1}, {2, 1, 0}}; | 111 {1, 2, 0}, {2, 0, 1}, {2, 1, 0}}; |
112 | 112 |
113 for (int i = 0; i < 6; ++i) { | 113 for (int i = 0; i < 6; ++i) { |
| 114 GrPipelineBuilder pipelineBuilder; |
114 SkAutoTUnref<GrFragmentProcessor> fp( | 115 SkAutoTUnref<GrFragmentProcessor> fp( |
115 GrYUVtoRGBEffect::Create(texture[indices[i][0]], | 116 GrYUVtoRGBEffect::Create(pipelineBuilder.getProcesso
rDataManager(), |
| 117 texture[indices[i][0]], |
116 texture[indices[i][1]], | 118 texture[indices[i][1]], |
117 texture[indices[i][2]], | 119 texture[indices[i][2]], |
118 sizes, | 120 sizes, |
119 static_cast<SkYUVColorSpace
>(space))); | 121 static_cast<SkYUVColorSpace
>(space))); |
120 if (fp) { | 122 if (fp) { |
121 SkMatrix viewMatrix; | 123 SkMatrix viewMatrix; |
122 viewMatrix.setTranslate(x, y); | 124 viewMatrix.setTranslate(x, y); |
123 GrPipelineBuilder pipelineBuilder; | |
124 pipelineBuilder.setRenderTarget(rt); | 125 pipelineBuilder.setRenderTarget(rt); |
125 pipelineBuilder.addColorProcessor(fp); | 126 pipelineBuilder.addColorProcessor(fp); |
126 tt.target()->drawSimpleRect(&pipelineBuilder, | 127 tt.target()->drawSimpleRect(&pipelineBuilder, |
127 GrColor_WHITE, | 128 GrColor_WHITE, |
128 viewMatrix, | 129 viewMatrix, |
129 renderRect); | 130 renderRect); |
130 } | 131 } |
131 x += renderRect.width() + kTestPad; | 132 x += renderRect.width() + kTestPad; |
132 } | 133 } |
133 } | 134 } |
134 } | 135 } |
135 | 136 |
136 private: | 137 private: |
137 SkBitmap fBmp[3]; | 138 SkBitmap fBmp[3]; |
138 | 139 |
139 typedef GM INHERITED; | 140 typedef GM INHERITED; |
140 }; | 141 }; |
141 | 142 |
142 DEF_GM( return SkNEW(YUVtoRGBEffect); ) | 143 DEF_GM( return SkNEW(YUVtoRGBEffect); ) |
143 } | 144 } |
144 | 145 |
145 #endif | 146 #endif |
OLD | NEW |