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

Side by Side Diff: tests/BlitRowTest.cpp

Issue 536003002: Hide fields in SkImageInfo (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix qt Created 6 years, 3 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/BitmapTest.cpp ('k') | tests/CachedDecodingPixelRefTest.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 2011 Google Inc. 2 * Copyright 2011 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 "SkBitmap.h" 8 #include "SkBitmap.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 SkRect srcR = { 205 SkRect srcR = {
206 0, 0, SkIntToScalar(srcBM.width()), SkIntToScalar(srcBM.height()) }; 206 0, 0, SkIntToScalar(srcBM.width()), SkIntToScalar(srcBM.height()) };
207 207
208 // cons up a mesh to draw the bitmap with 208 // cons up a mesh to draw the bitmap with
209 Mesh mesh(srcBM, &paint); 209 Mesh mesh(srcBM, &paint);
210 210
211 SkImageInfo info = SkImageInfo::Make(W, H, kUnknown_SkColorType, 211 SkImageInfo info = SkImageInfo::Make(W, H, kUnknown_SkColorType,
212 kPremul_SkAlphaType); 212 kPremul_SkAlphaType);
213 213
214 for (size_t i = 0; i < SK_ARRAY_COUNT(gDstColorType); i++) { 214 for (size_t i = 0; i < SK_ARRAY_COUNT(gDstColorType); i++) {
215 info.fColorType = gDstColorType[i]; 215 info = info.makeColorType(gDstColorType[i]);
216 216
217 SkBitmap dstBM0, dstBM1; 217 SkBitmap dstBM0, dstBM1;
218 dstBM0.allocPixels(info); 218 dstBM0.allocPixels(info);
219 dstBM1.allocPixels(info); 219 dstBM1.allocPixels(info);
220 220
221 SkCanvas canvas0(dstBM0); 221 SkCanvas canvas0(dstBM0);
222 SkCanvas canvas1(dstBM1); 222 SkCanvas canvas1(dstBM1);
223 SkColor bgColor; 223 SkColor bgColor;
224 224
225 for (size_t j = 0; j < SK_ARRAY_COUNT(gDstBG); j++) { 225 for (size_t j = 0; j < SK_ARRAY_COUNT(gDstBG); j++) {
(...skipping 29 matching lines...) Expand all
255 } 255 }
256 } 256 }
257 } 257 }
258 } 258 }
259 } 259 }
260 260
261 DEF_TEST(BlitRow, reporter) { 261 DEF_TEST(BlitRow, reporter) {
262 test_00_FF(reporter); 262 test_00_FF(reporter);
263 test_diagonal(reporter); 263 test_diagonal(reporter);
264 } 264 }
OLDNEW
« no previous file with comments | « tests/BitmapTest.cpp ('k') | tests/CachedDecodingPixelRefTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698