OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkPath.h" | 10 #include "SkPath.h" |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 } else { | 133 } else { |
134 bm.eraseColor(0); | 134 bm.eraseColor(0); |
135 } | 135 } |
136 | 136 |
137 SkPaint paint; | 137 SkPaint paint; |
138 paint.setAntiAlias(true); | 138 paint.setAntiAlias(true); |
139 paint.setColor(SK_ColorBLUE); | 139 paint.setColor(SK_ColorBLUE); |
140 newc->drawCircle(50, 50, 49, paint); | 140 newc->drawCircle(50, 50, 49, paint); |
141 canvas->drawBitmap(bm, 10, 10); | 141 canvas->drawBitmap(bm, 10, 10); |
142 | 142 |
143 CGImageRef image = SkCreateCGImageRefWithColorspace(bm, NULL); | 143 CGImageRef image = SkCreateCGImageRefWithColorspace(bm, nullptr); |
144 | 144 |
145 SkBitmap bm2; | 145 SkBitmap bm2; |
146 SkCreateBitmapFromCGImage(&bm2, image); | 146 SkCreateBitmapFromCGImage(&bm2, image); |
147 CGImageRelease(image); | 147 CGImageRelease(image); |
148 | 148 |
149 canvas->drawBitmap(bm2, 10, 120); | 149 canvas->drawBitmap(bm2, 10, 120); |
150 } | 150 } |
151 | 151 |
152 class CGImageGM : public skiagm::GM { | 152 class CGImageGM : public skiagm::GM { |
153 public: | 153 public: |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 canvas->translate(80, 10); | 254 canvas->translate(80, 10); |
255 this->drawAndClip(canvas, fVPath, 200, 0); | 255 this->drawAndClip(canvas, fVPath, 200, 0); |
256 canvas->translate(0, 200); | 256 canvas->translate(0, 200); |
257 this->drawAndClip(canvas, fHPath, 200, 0); | 257 this->drawAndClip(canvas, fHPath, 200, 0); |
258 } | 258 } |
259 | 259 |
260 private: | 260 private: |
261 typedef skiagm::GM INHERITED; | 261 typedef skiagm::GM INHERITED; |
262 }; | 262 }; |
263 DEF_GM(return new ClipCubicGM;) | 263 DEF_GM(return new ClipCubicGM;) |
OLD | NEW |