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

Side by Side Diff: tests/CTest.cpp

Issue 665203004: move c api into include (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 2 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
(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 #include "sk_surface.h"
9 #include "Test.h"
10
11 static void test_c(skiatest::Reporter* reporter) {
12 sk_colortype_t ct = sk_colortype_get_default_8888();
13
14 sk_imageinfo_t info = {
15 1, 1, ct, PREMUL_SK_ALPHATYPE
16 };
17 uint32_t pixel[1] = { 0 };
18
19 sk_surface_t* surface = sk_surface_new_raster_direct(&info, pixel, sizeof(ui nt32_t));
20 sk_paint_t* paint = sk_paint_new();
21
22 sk_canvas_t* canvas = sk_surface_get_canvas(surface);
23 sk_canvas_draw_paint(canvas, paint);
24 REPORTER_ASSERT(reporter, 0xFF000000 == pixel[0]);
25
26 sk_paint_set_color(paint, sk_color_set_argb(0xFF, 0xFF, 0xFF, 0xFF));
27 sk_canvas_draw_paint(canvas, paint);
28 REPORTER_ASSERT(reporter, 0xFFFFFFFF == pixel[0]);
29
30 sk_paint_delete(paint);
31 sk_surface_delete(surface);
32 }
33
34 DEF_TEST(C_API, reporter) {
35 test_c(reporter);
36 }
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