Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: tests/ImageFilterCacheTest.cpp

Issue 1869503002: Make existing unit tests only run on GL contexts (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tests/GrTextureMipMapInvalidationTest.cpp ('k') | tests/ImageFilterTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2016 Google Inc. 2 * Copyright 2016 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 #include "Test.h" 8 #include "Test.h"
9 9
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 180
181 GrSurfaceDesc desc; 181 GrSurfaceDesc desc;
182 desc.fConfig = kSkia8888_GrPixelConfig; 182 desc.fConfig = kSkia8888_GrPixelConfig;
183 desc.fFlags = kNone_GrSurfaceFlags; 183 desc.fFlags = kNone_GrSurfaceFlags;
184 desc.fWidth = kFullSize; 184 desc.fWidth = kFullSize;
185 desc.fHeight = kFullSize; 185 desc.fHeight = kFullSize;
186 186
187 return context->textureProvider()->createTexture(desc, SkBudgeted::kNo, srcB M.getPixels(), 0); 187 return context->textureProvider()->createTexture(desc, SkBudgeted::kNo, srcB M.getPixels(), 0);
188 } 188 }
189 189
190 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ImageFilterCache_ImageBackedGPU, reporter, ct xInfo) { 190 DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(ImageFilterCache_ImageBackedGPU, reporter, ctxInfo) {
191 SkAutoTUnref<GrTexture> srcTexture(create_texture(ctxInfo.fGrContext)); 191 SkAutoTUnref<GrTexture> srcTexture(create_texture(ctxInfo.fGrContext));
192 if (!srcTexture) { 192 if (!srcTexture) {
193 return; 193 return;
194 } 194 }
195 195
196 GrBackendTextureDesc backendDesc; 196 GrBackendTextureDesc backendDesc;
197 backendDesc.fConfig = kSkia8888_GrPixelConfig; 197 backendDesc.fConfig = kSkia8888_GrPixelConfig;
198 backendDesc.fFlags = kNone_GrBackendTextureFlag; 198 backendDesc.fFlags = kNone_GrBackendTextureFlag;
199 backendDesc.fWidth = kFullSize; 199 backendDesc.fWidth = kFullSize;
200 backendDesc.fHeight = kFullSize; 200 backendDesc.fHeight = kFullSize;
201 backendDesc.fSampleCnt = 0; 201 backendDesc.fSampleCnt = 0;
202 backendDesc.fTextureHandle = srcTexture->getTextureHandle(); 202 backendDesc.fTextureHandle = srcTexture->getTextureHandle();
203 sk_sp<SkImage> srcImage(SkImage::MakeFromTexture(ctxInfo.fGrContext, backend Desc, kPremul_SkAlphaType)); 203 sk_sp<SkImage> srcImage(SkImage::MakeFromTexture(ctxInfo.fGrContext, backend Desc, kPremul_SkAlphaType));
204 if (!srcImage) { 204 if (!srcImage) {
205 return; 205 return;
206 } 206 }
207 207
208 test_image_backed(reporter, srcImage); 208 test_image_backed(reporter, srcImage);
209 } 209 }
210 210
211 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ImageFilterCache_GPUBacked, reporter, ctxInfo ) { 211 DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(ImageFilterCache_GPUBacked, reporter, ctxI nfo) {
212 212
213 SkAutoTUnref<GrTexture> srcTexture(create_texture(ctxInfo.fGrContext)); 213 SkAutoTUnref<GrTexture> srcTexture(create_texture(ctxInfo.fGrContext));
214 if (!srcTexture) { 214 if (!srcTexture) {
215 return; 215 return;
216 } 216 }
217 217
218 const SkIRect& full = SkIRect::MakeWH(kFullSize, kFullSize); 218 const SkIRect& full = SkIRect::MakeWH(kFullSize, kFullSize);
219 219
220 sk_sp<SkSpecialImage> fullImg(SkSpecialImage::MakeFromGpu(nullptr, full, 220 sk_sp<SkSpecialImage> fullImg(SkSpecialImage::MakeFromGpu(nullptr, full,
221 kNeedNewImageUniqu eID_SpecialImage, 221 kNeedNewImageUniqu eID_SpecialImage,
222 srcTexture)); 222 srcTexture));
223 223
224 const SkIRect& subset = SkIRect::MakeXYWH(kPad, kPad, kSmallerSize, kSmaller Size); 224 const SkIRect& subset = SkIRect::MakeXYWH(kPad, kPad, kSmallerSize, kSmaller Size);
225 225
226 sk_sp<SkSpecialImage> subsetImg(SkSpecialImage::MakeFromGpu(nullptr, subset, 226 sk_sp<SkSpecialImage> subsetImg(SkSpecialImage::MakeFromGpu(nullptr, subset,
227 kNeedNewImageUni queID_SpecialImage, 227 kNeedNewImageUni queID_SpecialImage,
228 srcTexture)); 228 srcTexture));
229 229
230 test_find_existing(reporter, fullImg, subsetImg); 230 test_find_existing(reporter, fullImg, subsetImg);
231 test_dont_find_if_diff_key(reporter, fullImg, subsetImg); 231 test_dont_find_if_diff_key(reporter, fullImg, subsetImg);
232 test_internal_purge(reporter, fullImg); 232 test_internal_purge(reporter, fullImg);
233 test_explicit_purging(reporter, fullImg, subsetImg); 233 test_explicit_purging(reporter, fullImg, subsetImg);
234 } 234 }
235 #endif 235 #endif
OLDNEW
« no previous file with comments | « tests/GrTextureMipMapInvalidationTest.cpp ('k') | tests/ImageFilterTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698