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

Side by Side Diff: tests/WritePixelsTest.cpp

Issue 227433009: Rename kPMColor_SkColorType to kN32_SkColorType. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 years, 8 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/SurfaceTest.cpp ('k') | tools/skdiff_utils.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 "SkBitmapDevice.h" 8 #include "SkBitmapDevice.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 canvasInfo = secretDevBitmap.info(); 206 canvasInfo = secretDevBitmap.info();
207 canvasRowBytes = secretDevBitmap.rowBytes(); 207 canvasRowBytes = secretDevBitmap.rowBytes();
208 canvasPixels = static_cast<const uint32_t*>(secretDevBitmap.getPixels()); 208 canvasPixels = static_cast<const uint32_t*>(secretDevBitmap.getPixels());
209 209
210 if (NULL == canvasPixels) { 210 if (NULL == canvasPixels) {
211 return false; 211 return false;
212 } 212 }
213 213
214 if (canvasInfo.width() != DEV_W || 214 if (canvasInfo.width() != DEV_W ||
215 canvasInfo.height() != DEV_H || 215 canvasInfo.height() != DEV_H ||
216 canvasInfo.colorType() != kPMColor_SkColorType) { 216 canvasInfo.colorType() != kN32_SkColorType) {
217 return false; 217 return false;
218 } 218 }
219 219
220 const SkImageInfo bmInfo = bitmap.info(); 220 const SkImageInfo bmInfo = bitmap.info();
221 221
222 SkIRect writeRect = SkIRect::MakeXYWH(writeX, writeY, bitmap.width(), bitmap .height()); 222 SkIRect writeRect = SkIRect::MakeXYWH(writeX, writeY, bitmap.width(), bitmap .height());
223 for (int cy = 0; cy < DEV_H; ++cy) { 223 for (int cy = 0; cy < DEV_H; ++cy) {
224 for (int cx = 0; cx < DEV_W; ++cx) { 224 for (int cx = 0; cx < DEV_W; ++cx) {
225 SkPMColor canvasPixel = canvasPixels[cx]; 225 SkPMColor canvasPixel = canvasPixels[cx];
226 if (writeRect.contains(cx, cy)) { 226 if (writeRect.contains(cx, cy)) {
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 SkIRect writeRect = SkIRect::MakeXYWH(rect.fLeft, rect.f Top, 462 SkIRect writeRect = SkIRect::MakeXYWH(rect.fLeft, rect.f Top,
463 bmp.width(), bmp.h eight()); 463 bmp.width(), bmp.h eight());
464 bool intersects = SkIRect::Intersects(canvasRect, writeR ect) ; 464 bool intersects = SkIRect::Intersects(canvasRect, writeR ect) ;
465 REPORTER_ASSERT(reporter, intersects == (idBefore != idA fter)); 465 REPORTER_ASSERT(reporter, intersects == (idBefore != idA fter));
466 } 466 }
467 } 467 }
468 } 468 }
469 } 469 }
470 } 470 }
471 } 471 }
OLDNEW
« no previous file with comments | « tests/SurfaceTest.cpp ('k') | tools/skdiff_utils.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698