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

Side by Side Diff: tests/ImageFilterCacheTest.cpp

Issue 1885623002: Make more unit tests run on Vulkan (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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
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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
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_GL_RENDERING_CONTEXTS(ImageFilterCache_GPUBacked, reporter, ctxI nfo) { 211 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ImageFilterCache_GPUBacked, reporter, ctxInfo ) {
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/GpuLayerCacheTest.cpp ('k') | tests/ImageFilterTest.cpp » ('j') | tests/Test.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698