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

Side by Side Diff: tests/CachedDecodingPixelRefTest.cpp

Issue 583453002: SkCanvas::drawImage is the new way for drawing an SkImage to a Canvas (Closed) Base URL: https://skia.googlesource.com/skia.git@refactor_skImage
Patch Set: Make SkImage::draw public temporary for compatibility reasons Created 6 years, 2 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/utils/SkLua.cpp ('k') | no next file » | 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 2013 Google Inc. 2 * Copyright 2013 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 "SkCachingPixelRef.h" 9 #include "SkCachingPixelRef.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 continue; 343 continue;
344 } 344 }
345 REPORTER_ASSERT(r, TestImageGenerator::Width() == image->width()); 345 REPORTER_ASSERT(r, TestImageGenerator::Width() == image->width());
346 REPORTER_ASSERT(r, TestImageGenerator::Height() == image->height()); 346 REPORTER_ASSERT(r, TestImageGenerator::Height() == image->height());
347 347
348 SkBitmap bitmap; 348 SkBitmap bitmap;
349 bitmap.allocN32Pixels(TestImageGenerator::Width(), TestImageGenerator::H eight()); 349 bitmap.allocN32Pixels(TestImageGenerator::Width(), TestImageGenerator::H eight());
350 SkCanvas canvas(bitmap); 350 SkCanvas canvas(bitmap);
351 const SkColor kDefaultColor = 0xffabcdef; 351 const SkColor kDefaultColor = 0xffabcdef;
352 canvas.clear(kDefaultColor); 352 canvas.clear(kDefaultColor);
353 image->draw(&canvas, 0, 0, NULL); 353 canvas.drawImage(image, 0, 0, NULL);
354 if (TestImageGenerator::kSucceedGetPixels_TestType == test) { 354 if (TestImageGenerator::kSucceedGetPixels_TestType == test) {
355 REPORTER_ASSERT( 355 REPORTER_ASSERT(
356 r, TestImageGenerator::Color() == *bitmap.getAddr32(0, 0)); 356 r, TestImageGenerator::Color() == *bitmap.getAddr32(0, 0));
357 } else { 357 } else {
358 REPORTER_ASSERT(r, kDefaultColor == bitmap.getColor(0,0)); 358 REPORTER_ASSERT(r, kDefaultColor == bitmap.getColor(0,0));
359 } 359 }
360 } 360 }
361 } 361 }
OLDNEW
« no previous file with comments | « src/utils/SkLua.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698