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

Side by Side Diff: gm/cgm.c

Issue 736133006: more c (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 | gm/cgms.cpp » ('j') | include/c/sk_matrix.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2014 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 // EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL
9 // DO NOT USE -- FOR INTERNAL TESTING ONLY
10
11 #include "sk_canvas.h"
12 #include "sk_paint.h"
13 #include "sk_shader.h"
14 #include "sk_surface.h"
15
16 extern void sk_test_c_api(sk_canvas_t*);
17
18 #define W 256
19 #define H 256
20
21 static sk_shader_t* make_shader() {
22 sk_point_t pts[] = { { 0, 0 }, { W, H } };
23 sk_color_t colors[] = { 0xFF00FF00, 0xFF0000FF };
24 return sk_shader_new_linear_gradient(pts, colors, NULL, 2, CLAMP_SK_SHADER_T ILEMODE, NULL);
25 }
26
27 void sk_test_c_api(sk_canvas_t* canvas) {
28 sk_paint_t* paint = sk_paint_new();
29 sk_paint_set_antialias(paint, true);
30
31 sk_paint_set_color(paint, 0xFFFFFFFF);
32 sk_canvas_draw_paint(canvas, paint);
33
34 sk_rect_t r = { 10, 10, W - 10, H - 10 };
35
36 sk_paint_set_color(paint, 0xFFFF0000);
37 sk_canvas_draw_rect(canvas, &r, paint);
38
39 sk_shader_t* shader = make_shader();
40 sk_paint_set_shader(paint, shader);
41 sk_shader_unref(shader);
42
43 sk_canvas_draw_oval(canvas, &r, paint);
44
45 sk_paint_delete(paint);
46 }
47
48
OLDNEW
« no previous file with comments | « no previous file | gm/cgms.cpp » ('j') | include/c/sk_matrix.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698