OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 // This test only works with the GPU backend. | 8 // This test only works with the GPU backend. |
9 | 9 |
10 #include "gm.h" | 10 #include "gm.h" |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 GrPorterDuffXPFactory::Create(SkXfermode::kSrc_Mode))->unref
(); | 115 GrPorterDuffXPFactory::Create(SkXfermode::kSrc_Mode))->unref
(); |
116 SkAutoTUnref<const GrFragmentProcessor> fp( | 116 SkAutoTUnref<const GrFragmentProcessor> fp( |
117 GrYUVEffect::CreateYUVToRGB(texture[indices[i][0]], | 117 GrYUVEffect::CreateYUVToRGB(texture[indices[i][0]], |
118 texture[indices[i][1]], | 118 texture[indices[i][1]], |
119 texture[indices[i][2]], | 119 texture[indices[i][2]], |
120 sizes, | 120 sizes, |
121 static_cast<SkYUVColorSp
ace>(space))); | 121 static_cast<SkYUVColorSp
ace>(space))); |
122 if (fp) { | 122 if (fp) { |
123 SkMatrix viewMatrix; | 123 SkMatrix viewMatrix; |
124 viewMatrix.setTranslate(x, y); | 124 viewMatrix.setTranslate(x, y); |
125 pipelineBuilder.setRenderTarget(drawContext->accessRenderTar
get()); | |
126 pipelineBuilder.addColorFragmentProcessor(fp); | 125 pipelineBuilder.addColorFragmentProcessor(fp); |
127 SkAutoTUnref<GrDrawBatch> batch( | 126 SkAutoTUnref<GrDrawBatch> batch( |
128 GrRectBatchFactory::CreateNonAAFill(GrColor_WHITE, v
iewMatrix, | 127 GrRectBatchFactory::CreateNonAAFill(GrColor_WHITE, v
iewMatrix, |
129 renderRect, null
ptr, nullptr)); | 128 renderRect, null
ptr, nullptr)); |
130 drawContext->drawContextPriv().testingOnly_drawBatch(pipelin
eBuilder, batch); | 129 drawContext->drawContextPriv().testingOnly_drawBatch(pipelin
eBuilder, batch); |
131 } | 130 } |
132 x += renderRect.width() + kTestPad; | 131 x += renderRect.width() + kTestPad; |
133 } | 132 } |
134 } | 133 } |
135 } | 134 } |
136 | 135 |
137 private: | 136 private: |
138 SkBitmap fBmp[3]; | 137 SkBitmap fBmp[3]; |
139 | 138 |
140 typedef GM INHERITED; | 139 typedef GM INHERITED; |
141 }; | 140 }; |
142 | 141 |
143 DEF_GM(return new YUVtoRGBEffect;) | 142 DEF_GM(return new YUVtoRGBEffect;) |
144 } | 143 } |
145 | 144 |
146 #endif | 145 #endif |
OLD | NEW |