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

Side by Side Diff: gm/fatpathfill.cpp

Issue 791763002: Revert of remove (dumb) canvas::NewRaster, and rename surface::NewRasterPMColor to N32Premul (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years 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 | « no previous file | gyp/skia_for_chromium_defines.gypi » ('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 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkPath.h" 10 #include "SkPath.h"
11 #include "SkSurface.h" 11 #include "SkSurface.h"
12 12
13 #define ZOOM 32 13 #define ZOOM 32
14 #define SMALL_W 9 14 #define SMALL_W 9
15 #define SMALL_H 3 15 #define SMALL_H 3
16 #define REPEAT_LOOP 5 16 #define REPEAT_LOOP 5
17 17
18 static SkSurface* new_surface(int width, int height) { 18 static SkSurface* new_surface(int width, int height) {
19 return SkSurface::NewRasterN32Premul(width, height); 19 return SkSurface::NewRasterPMColor(width, height);
20 } 20 }
21 21
22 static void draw_pixel_centers(SkCanvas* canvas) { 22 static void draw_pixel_centers(SkCanvas* canvas) {
23 SkPaint paint; 23 SkPaint paint;
24 paint.setColor(0xFF0088FF); 24 paint.setColor(0xFF0088FF);
25 paint.setAntiAlias(true); 25 paint.setAntiAlias(true);
26 26
27 for (int y = 0; y < SMALL_H; ++y) { 27 for (int y = 0; y < SMALL_H; ++y) {
28 for (int x = 0; x < SMALL_W; ++x) { 28 for (int x = 0; x < SMALL_W; ++x) {
29 canvas->drawCircle(x + 0.5f, y + 0.5f, 1.5f / ZOOM, paint); 29 canvas->drawCircle(x + 0.5f, y + 0.5f, 1.5f / ZOOM, paint);
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 } 88 }
89 } 89 }
90 90
91 private: 91 private:
92 typedef skiagm::GM INHERITED; 92 typedef skiagm::GM INHERITED;
93 }; 93 };
94 94
95 /////////////////////////////////////////////////////////////////////////////// 95 ///////////////////////////////////////////////////////////////////////////////
96 96
97 DEF_GM(return new FatPathFillGM;) 97 DEF_GM(return new FatPathFillGM;)
OLDNEW
« no previous file with comments | « no previous file | gyp/skia_for_chromium_defines.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698