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 |
11 #include "gm.h" | 11 #include "gm.h" |
12 | 12 |
13 #if SK_SUPPORT_GPU | 13 #if SK_SUPPORT_GPU |
14 | 14 |
15 #include "GrContext.h" | 15 #include "GrContext.h" |
16 #include "GrDrawContext.h" | 16 #include "GrDrawContextPriv.h" |
17 #include "GrPipelineBuilder.h" | 17 #include "GrPipelineBuilder.h" |
18 #include "SkBitmap.h" | 18 #include "SkBitmap.h" |
19 #include "SkGr.h" | 19 #include "SkGr.h" |
20 #include "SkGradientShader.h" | 20 #include "SkGradientShader.h" |
21 #include "batches/GrDrawBatch.h" | 21 #include "batches/GrDrawBatch.h" |
22 #include "batches/GrRectBatchFactory.h" | 22 #include "batches/GrRectBatchFactory.h" |
23 #include "effects/GrYUVEffect.h" | 23 #include "effects/GrYUVEffect.h" |
24 | 24 |
25 #define YSIZE 8 | 25 #define YSIZE 8 |
26 #define USIZE 4 | 26 #define USIZE 4 |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 sizes, | 125 sizes, |
126 static_cast<SkYUVColorSp
ace>(space))); | 126 static_cast<SkYUVColorSp
ace>(space))); |
127 if (fp) { | 127 if (fp) { |
128 SkMatrix viewMatrix; | 128 SkMatrix viewMatrix; |
129 viewMatrix.setTranslate(x, y); | 129 viewMatrix.setTranslate(x, y); |
130 pipelineBuilder.setRenderTarget(rt); | 130 pipelineBuilder.setRenderTarget(rt); |
131 pipelineBuilder.addColorFragmentProcessor(fp); | 131 pipelineBuilder.addColorFragmentProcessor(fp); |
132 SkAutoTUnref<GrDrawBatch> batch( | 132 SkAutoTUnref<GrDrawBatch> batch( |
133 GrRectBatchFactory::CreateNonAAFill(GrColor_WHITE, v
iewMatrix, | 133 GrRectBatchFactory::CreateNonAAFill(GrColor_WHITE, v
iewMatrix, |
134 renderRect, null
ptr, nullptr)); | 134 renderRect, null
ptr, nullptr)); |
135 drawContext->internal_drawBatch(pipelineBuilder, batch); | 135 drawContext->drawContextPriv().testingOnly_drawBatch(pipelin
eBuilder, batch); |
136 } | 136 } |
137 x += renderRect.width() + kTestPad; | 137 x += renderRect.width() + kTestPad; |
138 } | 138 } |
139 } | 139 } |
140 } | 140 } |
141 | 141 |
142 private: | 142 private: |
143 SkBitmap fBmp[3]; | 143 SkBitmap fBmp[3]; |
144 | 144 |
145 typedef GM INHERITED; | 145 typedef GM INHERITED; |
146 }; | 146 }; |
147 | 147 |
148 DEF_GM(return new YUVtoRGBEffect;) | 148 DEF_GM(return new YUVtoRGBEffect;) |
149 } | 149 } |
150 | 150 |
151 #endif | 151 #endif |
OLD | NEW |