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

Side by Side Diff: tests/ImageFilterCacheTest.cpp

Issue 1810323002: Cache render targets that render to wrapped textures Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(context, backendDesc, kPrem ul_SkAlphaType)); 203 sk_sp<SkImage> srcImage(SkImage::MakeFromTextureCopy(context, backendDesc, k Premul_SkAlphaType));
204 if (!srcImage) { 204 if (!srcImage) {
205 return; 205 return;
206 } 206 }
207 srcTexture.reset();
207 208
208 test_image_backed(reporter, srcImage); 209 test_image_backed(reporter, srcImage);
209 } 210 }
210 211
211 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ImageFilterCache_GPUBacked, reporter, context ) { 212 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ImageFilterCache_GPUBacked, reporter, context ) {
212 213
213 SkAutoTUnref<GrTexture> srcTexture(create_texture(context)); 214 SkAutoTUnref<GrTexture> srcTexture(create_texture(context));
214 if (!srcTexture) { 215 if (!srcTexture) {
215 return; 216 return;
216 } 217 }
(...skipping 10 matching lines...) Expand all
227 kNeedNewImageUni queID_SpecialImage, 228 kNeedNewImageUni queID_SpecialImage,
228 srcTexture)); 229 srcTexture));
229 230
230 test_find_existing(reporter, fullImg, subsetImg); 231 test_find_existing(reporter, fullImg, subsetImg);
231 test_dont_find_if_diff_key(reporter, fullImg, subsetImg); 232 test_dont_find_if_diff_key(reporter, fullImg, subsetImg);
232 test_internal_purge(reporter, fullImg); 233 test_internal_purge(reporter, fullImg);
233 test_explicit_purging(reporter, fullImg, subsetImg); 234 test_explicit_purging(reporter, fullImg, subsetImg);
234 } 235 }
235 #endif 236 #endif
236 237
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698