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

Side by Side Diff: tests/ImageFilterCacheTest.cpp

Issue 1772933002: Switch SkImageSource image filter over to new onFilterImage interface (Closed) Base URL: https://skia.googlesource.com/skia.git@if-follow-on
Patch Set: update to ToT again 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
« no previous file with comments | « src/effects/SkImageSource.cpp ('k') | tests/SpecialImageTest.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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 test_dont_find_if_diff_key(reporter, fullImg, subsetImg); 145 test_dont_find_if_diff_key(reporter, fullImg, subsetImg);
146 test_internal_purge(reporter, fullImg); 146 test_internal_purge(reporter, fullImg);
147 test_explicit_purging(reporter, fullImg, subsetImg); 147 test_explicit_purging(reporter, fullImg, subsetImg);
148 } 148 }
149 149
150 150
151 // Shared test code for both the raster and gpu-backed image cases 151 // Shared test code for both the raster and gpu-backed image cases
152 static void test_image_backed(skiatest::Reporter* reporter, SkImage* srcImage) { 152 static void test_image_backed(skiatest::Reporter* reporter, SkImage* srcImage) {
153 const SkIRect& full = SkIRect::MakeWH(kFullSize, kFullSize); 153 const SkIRect& full = SkIRect::MakeWH(kFullSize, kFullSize);
154 154
155 SkAutoTUnref<SkSpecialImage> fullImg(SkSpecialImage::NewFromImage(full, srcI mage)); 155 SkAutoTUnref<SkSpecialImage> fullImg(SkSpecialImage::NewFromImage(nullptr, f ull, srcImage));
156 156
157 const SkIRect& subset = SkIRect::MakeXYWH(kPad, kPad, kSmallerSize, kSmaller Size); 157 const SkIRect& subset = SkIRect::MakeXYWH(kPad, kPad, kSmallerSize, kSmaller Size);
158 158
159 SkAutoTUnref<SkSpecialImage> subsetImg(SkSpecialImage::NewFromImage(subset, srcImage)); 159 SkAutoTUnref<SkSpecialImage> subsetImg(SkSpecialImage::NewFromImage(nullptr,
160 subset,
161 srcImage ));
160 162
161 test_find_existing(reporter, fullImg, subsetImg); 163 test_find_existing(reporter, fullImg, subsetImg);
162 test_dont_find_if_diff_key(reporter, fullImg, subsetImg); 164 test_dont_find_if_diff_key(reporter, fullImg, subsetImg);
163 test_internal_purge(reporter, fullImg); 165 test_internal_purge(reporter, fullImg);
164 test_explicit_purging(reporter, fullImg, subsetImg); 166 test_explicit_purging(reporter, fullImg, subsetImg);
165 } 167 }
166 168
167 DEF_TEST(ImageFilterCache_ImageBackedRaster, reporter) { 169 DEF_TEST(ImageFilterCache_ImageBackedRaster, reporter) {
168 SkBitmap srcBM = create_bm(); 170 SkBitmap srcBM = create_bm();
169 171
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 kNeedNewImageUni queID_SpecialImage, 232 kNeedNewImageUni queID_SpecialImage,
231 srcTexture)); 233 srcTexture));
232 234
233 test_find_existing(reporter, fullImg, subsetImg); 235 test_find_existing(reporter, fullImg, subsetImg);
234 test_dont_find_if_diff_key(reporter, fullImg, subsetImg); 236 test_dont_find_if_diff_key(reporter, fullImg, subsetImg);
235 test_internal_purge(reporter, fullImg); 237 test_internal_purge(reporter, fullImg);
236 test_explicit_purging(reporter, fullImg, subsetImg); 238 test_explicit_purging(reporter, fullImg, subsetImg);
237 } 239 }
238 #endif 240 #endif
239 241
OLDNEW
« no previous file with comments | « src/effects/SkImageSource.cpp ('k') | tests/SpecialImageTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698