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

Side by Side Diff: gm/gm.h

Issue 16410009: Add an option to create unpremultiplied bitmaps. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Fix for andriod only code. Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « bench/ImageDecodeBench.cpp ('k') | gyp/SampleApp.gyp » ('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 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #ifndef skiagm_DEFINED 8 #ifndef skiagm_DEFINED
9 #define skiagm_DEFINED 9 #define skiagm_DEFINED
10 10
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 void setBGColor(SkColor); 73 void setBGColor(SkColor);
74 74
75 // helper: fill a rect in the specified color based on the 75 // helper: fill a rect in the specified color based on the
76 // GM's getISize bounds. 76 // GM's getISize bounds.
77 void drawSizeBounds(SkCanvas*, SkColor); 77 void drawSizeBounds(SkCanvas*, SkColor);
78 78
79 static void SetResourcePath(const char* resourcePath) { 79 static void SetResourcePath(const char* resourcePath) {
80 gResourcePath = resourcePath; 80 gResourcePath = resourcePath;
81 } 81 }
82 82
83 static SkString& GetResourcePath() {
84 return gResourcePath;
85 }
86
83 bool isCanvasDeferred() const { return fCanvasIsDeferred; } 87 bool isCanvasDeferred() const { return fCanvasIsDeferred; }
84 void setCanvasIsDeferred(bool isDeferred) { 88 void setCanvasIsDeferred(bool isDeferred) {
85 fCanvasIsDeferred = isDeferred; 89 fCanvasIsDeferred = isDeferred;
86 } 90 }
87 91
88 protected: 92 protected:
89 static SkString gResourcePath; 93 static SkString gResourcePath;
90 94
91 virtual void onOnceBeforeDraw() {} 95 virtual void onOnceBeforeDraw() {}
92 virtual void onDraw(SkCanvas*) = 0; 96 virtual void onDraw(SkCanvas*) = 0;
93 virtual void onDrawBackground(SkCanvas*); 97 virtual void onDrawBackground(SkCanvas*);
94 virtual SkISize onISize() = 0; 98 virtual SkISize onISize() = 0;
95 virtual SkString onShortName() = 0; 99 virtual SkString onShortName() = 0;
96 virtual uint32_t onGetFlags() const { return 0; } 100 virtual uint32_t onGetFlags() const { return 0; }
97 virtual SkMatrix onGetInitialTransform() const { return SkMatrix::I(); } 101 virtual SkMatrix onGetInitialTransform() const { return SkMatrix::I(); }
98 102
99 private: 103 private:
100 SkString fShortName; 104 SkString fShortName;
101 SkColor fBGColor; 105 SkColor fBGColor;
102 bool fCanvasIsDeferred; // work-around problem in srcmode.cpp 106 bool fCanvasIsDeferred; // work-around problem in srcmode.cpp
103 bool fHaveCalledOnceBeforeDraw; 107 bool fHaveCalledOnceBeforeDraw;
104 }; 108 };
105 109
106 typedef SkTRegistry<GM*, void*> GMRegistry; 110 typedef SkTRegistry<GM*, void*> GMRegistry;
107 } 111 }
108 112
109 #endif 113 #endif
OLDNEW
« no previous file with comments | « bench/ImageDecodeBench.cpp ('k') | gyp/SampleApp.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698