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

Side by Side Diff: gm/astcbitmap.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 | « gm/all_bitmap_configs.cpp ('k') | gm/bigtileimagefilter.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 2014 Google Inc. 2 * Copyright 2014 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 "gm.h" 8 #include "gm.h"
9 9
10 #include "Resources.h" 10 #include "Resources.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 const SkScalar bmY = static_cast<SkScalar>(j*kBitmapDimension); 55 const SkScalar bmY = static_cast<SkScalar>(j*kBitmapDimension);
56 canvas->drawBitmap(bm, bmX, bmY); 56 canvas->drawBitmap(bm, bmX, bmY);
57 } 57 }
58 } 58 }
59 } 59 }
60 } 60 }
61 61
62 DEF_SIMPLE_GM(astc_image, canvas, kGMDimension, kGMDimension) { 62 DEF_SIMPLE_GM(astc_image, canvas, kGMDimension, kGMDimension) {
63 for (int j = 0; j < 4; ++j) { 63 for (int j = 0; j < 4; ++j) {
64 for (int i = 0; i < 4; ++i) { 64 for (int i = 0; i < 4; ++i) {
65 SkAutoTUnref<SkImage> image(GetResourceAsImage(get_astc_filename(j*4 +i))); 65 sk_sp<SkImage> image(GetResourceAsImage(get_astc_filename(j*4+i)));
66 if (image) { 66 if (image) {
67 const SkScalar bmX = static_cast<SkScalar>(i*kBitmapDimension); 67 const SkScalar bmX = static_cast<SkScalar>(i*kBitmapDimension);
68 const SkScalar bmY = static_cast<SkScalar>(j*kBitmapDimension); 68 const SkScalar bmY = static_cast<SkScalar>(j*kBitmapDimension);
69 canvas->drawImage(image, bmX, bmY); 69 canvas->drawImage(image, bmX, bmY);
70 } 70 }
71 } 71 }
72 } 72 }
73 } 73 }
OLDNEW
« no previous file with comments | « gm/all_bitmap_configs.cpp ('k') | gm/bigtileimagefilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698