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

Side by Side Diff: gm/factory.cpp

Issue 544233002: "NULL !=" = NULL (Closed) Base URL: https://skia.googlesource.com/skia.git@are
Patch Set: rebase Created 6 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/convexpolyeffect.cpp ('k') | gm/gmmain.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 2012 Google Inc. 2 * Copyright 2012 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 14 matching lines...) Expand all
25 */ 25 */
26 class FactoryGM : public GM { 26 class FactoryGM : public GM {
27 public: 27 public:
28 FactoryGM() {} 28 FactoryGM() {}
29 29
30 protected: 30 protected:
31 virtual void onOnceBeforeDraw() SK_OVERRIDE { 31 virtual void onOnceBeforeDraw() SK_OVERRIDE {
32 // Copyright-free file from http://openclipart.org/detail/29213/paper-pl ane-by-ddoo 32 // Copyright-free file from http://openclipart.org/detail/29213/paper-pl ane-by-ddoo
33 SkString pngFilename = GetResourcePath("plane.png"); 33 SkString pngFilename = GetResourcePath("plane.png");
34 SkAutoDataUnref data(SkData::NewFromFileName(pngFilename.c_str())); 34 SkAutoDataUnref data(SkData::NewFromFileName(pngFilename.c_str()));
35 if (NULL != data.get()) { 35 if (data.get()) {
36 // Create a cache which will boot the pixels out anytime the 36 // Create a cache which will boot the pixels out anytime the
37 // bitmap is unlocked. 37 // bitmap is unlocked.
38 SkAutoTUnref<SkDiscardableMemoryPool> pool( 38 SkAutoTUnref<SkDiscardableMemoryPool> pool(
39 SkDiscardableMemoryPool::Create(1)); 39 SkDiscardableMemoryPool::Create(1));
40 SkAssertResult(SkInstallDiscardablePixelRef( 40 SkAssertResult(SkInstallDiscardablePixelRef(
41 SkDecodingImageGenerator::Create( 41 SkDecodingImageGenerator::Create(
42 data, SkDecodingImageGenerator::Options()), 42 data, SkDecodingImageGenerator::Options()),
43 &fBitmap, pool)); 43 &fBitmap, pool));
44 } 44 }
45 } 45 }
(...skipping 20 matching lines...) Expand all
66 66
67 typedef GM INHERITED; 67 typedef GM INHERITED;
68 }; 68 };
69 69
70 ////////////////////////////////////////////////////////////////////////////// 70 //////////////////////////////////////////////////////////////////////////////
71 71
72 static GM* MyFactory(void*) { return new FactoryGM; } 72 static GM* MyFactory(void*) { return new FactoryGM; }
73 static GMRegistry reg(MyFactory); 73 static GMRegistry reg(MyFactory);
74 74
75 } // namespace skiagm 75 } // namespace skiagm
OLDNEW
« no previous file with comments | « gm/convexpolyeffect.cpp ('k') | gm/gmmain.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698