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

Side by Side Diff: tests/CTest.cpp

Issue 1307183006: C API: Add SK_API, also documentation of an example. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-09-01 (Tuesday) 12:56:15 EDT Created 5 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 | « src/c/sk_surface.cpp ('k') | no next file » | 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 2014 Google Inc. 2 * Copyright 2014 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 "Test.h"
9
8 #include "sk_canvas.h" 10 #include "sk_canvas.h"
9 #include "sk_paint.h" 11 #include "sk_paint.h"
10 #include "sk_surface.h" 12 #include "sk_surface.h"
11 #include "sk_shader.h" 13 #include "sk_shader.h"
12 14
13 #include "Test.h"
14
15
16 static void shader_test(skiatest::Reporter* reporter) { 15 static void shader_test(skiatest::Reporter* reporter) {
17 sk_imageinfo_t info = 16 sk_imageinfo_t info =
18 {64, 64, sk_colortype_get_default_8888(), PREMUL_SK_ALPHATYPE}; 17 {64, 64, sk_colortype_get_default_8888(), PREMUL_SK_ALPHATYPE};
19 sk_surface_t* surface = sk_surface_new_raster(&info, nullptr); 18 sk_surface_t* surface = sk_surface_new_raster(&info, nullptr);
20 sk_canvas_t* canvas = sk_surface_get_canvas(surface); 19 sk_canvas_t* canvas = sk_surface_get_canvas(surface);
21 sk_paint_t* paint = sk_paint_new(); 20 sk_paint_t* paint = sk_paint_new();
22 21
23 sk_shader_tilemode_t tilemode = CLAMP_SK_SHADER_TILEMODE; 22 sk_shader_tilemode_t tilemode = CLAMP_SK_SHADER_TILEMODE;
24 sk_point_t point = {0.0f, 0.0f}; 23 sk_point_t point = {0.0f, 0.0f};
25 sk_point_t point2 = {30.0f, 40.0f}; 24 sk_point_t point2 = {30.0f, 40.0f};
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 REPORTER_ASSERT(reporter, 0x80404040 == pixel[0]); 79 REPORTER_ASSERT(reporter, 0x80404040 == pixel[0]);
81 80
82 sk_paint_delete(paint); 81 sk_paint_delete(paint);
83 sk_surface_unref(surface); 82 sk_surface_unref(surface);
84 } 83 }
85 84
86 DEF_TEST(C_API, reporter) { 85 DEF_TEST(C_API, reporter) {
87 test_c(reporter); 86 test_c(reporter);
88 shader_test(reporter); 87 shader_test(reporter);
89 } 88 }
OLDNEW
« no previous file with comments | « src/c/sk_surface.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698