| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |