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

Side by Side Diff: gm/astcbitmap.cpp

Issue 1316233002: Style Change: NULL->nullptr (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-27 (Thursday) 10:25:06 EDT Created 5 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 | « gm/arithmode.cpp ('k') | gm/beziereffects.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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 63
64 void onDraw(SkCanvas* canvas) override { 64 void onDraw(SkCanvas* canvas) override {
65 for (int j = 0; j < 4; ++j) { 65 for (int j = 0; j < 4; ++j) {
66 for (int i = 0; i < 4; ++i) { 66 for (int i = 0; i < 4; ++i) {
67 SkString filename = GetResourcePath(get_astc_filename(j*4+i)); 67 SkString filename = GetResourcePath(get_astc_filename(j*4+i));
68 if (filename == GetResourcePath("")) { 68 if (filename == GetResourcePath("")) {
69 continue; 69 continue;
70 } 70 }
71 71
72 SkAutoTUnref<SkData> fileData(SkData::NewFromFileName(filename.c _str())); 72 SkAutoTUnref<SkData> fileData(SkData::NewFromFileName(filename.c _str()));
73 if (NULL == fileData) { 73 if (nullptr == fileData) {
74 SkDebugf("Could not open the file. Did you forget to set the resourcePath?\n"); 74 SkDebugf("Could not open the file. Did you forget to set the resourcePath?\n");
75 return; 75 return;
76 } 76 }
77 77
78 SkBitmap bm; 78 SkBitmap bm;
79 if (!SkInstallDiscardablePixelRef(fileData, &bm)) { 79 if (!SkInstallDiscardablePixelRef(fileData, &bm)) {
80 SkDebugf("Could not install discardable pixel ref.\n"); 80 SkDebugf("Could not install discardable pixel ref.\n");
81 return; 81 return;
82 } 82 }
83 83
84 const SkScalar bmX = static_cast<SkScalar>(i*kBitmapDimension); 84 const SkScalar bmX = static_cast<SkScalar>(i*kBitmapDimension);
85 const SkScalar bmY = static_cast<SkScalar>(j*kBitmapDimension); 85 const SkScalar bmY = static_cast<SkScalar>(j*kBitmapDimension);
86 canvas->drawBitmap(bm, bmX, bmY); 86 canvas->drawBitmap(bm, bmX, bmY);
87 } 87 }
88 } 88 }
89 } 89 }
90 90
91 private: 91 private:
92 static const int kGMDimension = 600; 92 static const int kGMDimension = 600;
93 static const int kBitmapDimension = kGMDimension/4; 93 static const int kBitmapDimension = kGMDimension/4;
94 94
95 typedef GM INHERITED; 95 typedef GM INHERITED;
96 }; 96 };
97 97
98 } // namespace skiagm 98 } // namespace skiagm
99 99
100 ////////////////////////////////////////////////////////////////////////////// 100 //////////////////////////////////////////////////////////////////////////////
101 101
102 DEF_GM(return new skiagm::ASTCBitmapGM;) 102 DEF_GM(return new skiagm::ASTCBitmapGM;)
OLDNEW
« no previous file with comments | « gm/arithmode.cpp ('k') | gm/beziereffects.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698