OLD | NEW |
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 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 REPORTER_ASSERT(reporter, bmp.isNull()); | 374 REPORTER_ASSERT(reporter, bmp.isNull()); |
375 } | 375 } |
376 } | 376 } |
377 // check the old webkit version of readPixels that clips the | 377 // check the old webkit version of readPixels that clips the |
378 // bitmap size | 378 // bitmap size |
379 SkBitmap wkbmp; | 379 SkBitmap wkbmp; |
380 bool success = canvas.readPixels(srcRect, &wkbmp); | 380 bool success = canvas.readPixels(srcRect, &wkbmp); |
381 SkIRect clippedRect = DEV_RECT; | 381 SkIRect clippedRect = DEV_RECT; |
382 if (clippedRect.intersect(srcRect)) { | 382 if (clippedRect.intersect(srcRect)) { |
383 REPORTER_ASSERT(reporter, success); | 383 REPORTER_ASSERT(reporter, success); |
384 REPORTER_ASSERT(reporter, kPMColor_SkColorType == wkbmp.
colorType()); | 384 REPORTER_ASSERT(reporter, kN32_SkColorType == wkbmp.colo
rType()); |
385 REPORTER_ASSERT(reporter, kPremul_SkAlphaType == wkbmp.a
lphaType()); | 385 REPORTER_ASSERT(reporter, kPremul_SkAlphaType == wkbmp.a
lphaType()); |
386 checkRead(reporter, wkbmp, clippedRect.fLeft, | 386 checkRead(reporter, wkbmp, clippedRect.fLeft, |
387 clippedRect.fTop, true, false); | 387 clippedRect.fTop, true, false); |
388 } else { | 388 } else { |
389 REPORTER_ASSERT(reporter, !success); | 389 REPORTER_ASSERT(reporter, !success); |
390 } | 390 } |
391 } | 391 } |
392 } | 392 } |
393 } | 393 } |
394 } | 394 } |
395 } | 395 } |
OLD | NEW |