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

Side by Side Diff: tests/SpecialImageTest.cpp

Issue 1810813003: update callsites for Make image factories (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: start to take advantage of sk_sp drawImage 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 | « tests/SkResourceCacheTest.cpp ('k') | tests/SurfaceTest.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 "SkAutoPixmapStorage.h" 8 #include "SkAutoPixmapStorage.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 112
113 { 113 {
114 SkAutoTUnref<SkSpecialImage> subSImg2(fullSImage->extractSubset(subset)) ; 114 SkAutoTUnref<SkSpecialImage> subSImg2(fullSImage->extractSubset(subset)) ;
115 test_image(subSImg2, reporter, true, false, 0, kSmallerSize); 115 test_image(subSImg2, reporter, true, false, 0, kSmallerSize);
116 } 116 }
117 } 117 }
118 118
119 DEF_TEST(SpecialImage_Image, reporter) { 119 DEF_TEST(SpecialImage_Image, reporter) {
120 SkBitmap bm = create_bm(); 120 SkBitmap bm = create_bm();
121 121
122 SkAutoTUnref<SkImage> fullImage(SkImage::NewFromBitmap(bm)); 122 sk_sp<SkImage> fullImage(SkImage::MakeFromBitmap(bm));
123 123
124 SkAutoTUnref<SkSpecialImage> fullSImage(SkSpecialImage::NewFromImage( 124 SkAutoTUnref<SkSpecialImage> fullSImage(SkSpecialImage::NewFromImage(
125 nullptr, 125 nullptr,
126 SkIRect::MakeWH(kFul lSize, kFullSize), 126 SkIRect::MakeWH(kFul lSize, kFullSize),
127 fullImage)); 127 fullImage.get()));
128 128
129 const SkIRect& subset = SkIRect::MakeXYWH(kPad, kPad, kSmallerSize, kSmaller Size); 129 const SkIRect& subset = SkIRect::MakeXYWH(kPad, kPad, kSmallerSize, kSmaller Size);
130 130
131 { 131 {
132 SkAutoTUnref<SkSpecialImage> subSImg1(SkSpecialImage::NewFromImage(nullp tr, 132 SkAutoTUnref<SkSpecialImage> subSImg1(SkSpecialImage::NewFromImage(nullp tr,
133 subse t, 133 subse t,
134 fullI mage)); 134 fullI mage.get()));
135 test_image(subSImg1, reporter, true, false, kPad, kFullSize); 135 test_image(subSImg1, reporter, true, false, kPad, kFullSize);
136 } 136 }
137 137
138 { 138 {
139 SkAutoTUnref<SkSpecialImage> subSImg2(fullSImage->extractSubset(subset)) ; 139 SkAutoTUnref<SkSpecialImage> subSImg2(fullSImage->extractSubset(subset)) ;
140 test_image(subSImg2, reporter, true, false, 0, kSmallerSize); 140 test_image(subSImg2, reporter, true, false, 0, kSmallerSize);
141 } 141 }
142 } 142 }
143 143
144 DEF_TEST(SpecialImage_Pixmap, reporter) { 144 DEF_TEST(SpecialImage_Pixmap, reporter) {
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 test_image(subSImg1, reporter, false, true, kPad, kFullSize); 203 test_image(subSImg1, reporter, false, true, kPad, kFullSize);
204 } 204 }
205 205
206 { 206 {
207 SkAutoTUnref<SkSpecialImage> subSImg2(fullSImg->extractSubset(subset)); 207 SkAutoTUnref<SkSpecialImage> subSImg2(fullSImg->extractSubset(subset));
208 test_image(subSImg2, reporter, false, true, kPad, kFullSize); 208 test_image(subSImg2, reporter, false, true, kPad, kFullSize);
209 } 209 }
210 } 210 }
211 211
212 #endif 212 #endif
OLDNEW
« no previous file with comments | « tests/SkResourceCacheTest.cpp ('k') | tests/SurfaceTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698