OLD | NEW |
1 | |
2 /* | 1 /* |
3 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
4 * | 3 * |
5 * 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 |
6 * found in the LICENSE file. | 5 * found in the LICENSE file. |
7 */ | 6 */ |
8 | 7 |
9 // This test only works with the GPU backend. | 8 // This test only works with the GPU backend. |
10 | 9 |
11 #include "gm.h" | 10 #include "gm.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 | 94 |
96 void createYUVTextures(GrContext* context, GrBackendObject yuvHandles[3]) { | 95 void createYUVTextures(GrContext* context, GrBackendObject yuvHandles[3]) { |
97 GrGpu* gpu = context->getGpu(); | 96 GrGpu* gpu = context->getGpu(); |
98 if (!gpu) { | 97 if (!gpu) { |
99 return; | 98 return; |
100 } | 99 } |
101 | 100 |
102 for (int i = 0; i < 3; ++i) { | 101 for (int i = 0; i < 3; ++i) { |
103 SkASSERT(fYUVBmps[i].width() == SkToInt(fYUVBmps[i].rowBytes())); | 102 SkASSERT(fYUVBmps[i].width() == SkToInt(fYUVBmps[i].rowBytes())); |
104 yuvHandles[i] = gpu->createTestingOnlyBackendTexture(fYUVBmps[i].get
Pixels(), | 103 yuvHandles[i] = gpu->createTestingOnlyBackendTexture(fYUVBmps[i].get
Pixels(), |
105 fYUVBmps[i].wid
th(), | 104 fYUVBmps[i].wid
th(), |
106 fYUVBmps[i].hei
ght(), | 105 fYUVBmps[i].hei
ght(), |
107 kAlpha_8_GrPixe
lConfig); | 106 kAlpha_8_GrPixe
lConfig); |
108 } | 107 } |
109 context->resetContext(); | 108 context->resetContext(); |
110 } | 109 } |
111 | 110 |
112 void deleteYUVTextures(GrContext* context, const GrBackendObject yuvHandles[
3]) { | 111 void deleteYUVTextures(GrContext* context, const GrBackendObject yuvHandles[
3]) { |
113 | 112 |
114 GrGpu* gpu = context->getGpu(); | 113 GrGpu* gpu = context->getGpu(); |
115 if (!gpu) { | 114 if (!gpu) { |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 | 163 |
165 static const int kBmpSize = 32; | 164 static const int kBmpSize = 32; |
166 | 165 |
167 typedef GM INHERITED; | 166 typedef GM INHERITED; |
168 }; | 167 }; |
169 | 168 |
170 DEF_GM(return new ImageFromYUVTextures;) | 169 DEF_GM(return new ImageFromYUVTextures;) |
171 } | 170 } |
172 | 171 |
173 #endif | 172 #endif |
OLD | NEW |