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

Side by Side Diff: tests/CTest.cpp

Issue 1195003003: Propagate SkSurfaceProps to more call sites (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 6 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/utils/SkLua.cpp ('k') | tools/skhello.cpp » ('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 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 "sk_canvas.h" 8 #include "sk_canvas.h"
9 #include "sk_paint.h" 9 #include "sk_paint.h"
10 #include "sk_surface.h" 10 #include "sk_surface.h"
11 11
12 #include "Test.h" 12 #include "Test.h"
13 13
14 static void test_c(skiatest::Reporter* reporter) { 14 static void test_c(skiatest::Reporter* reporter) {
15 sk_colortype_t ct = sk_colortype_get_default_8888(); 15 sk_colortype_t ct = sk_colortype_get_default_8888();
16 16
17 sk_imageinfo_t info = { 17 sk_imageinfo_t info = {
18 1, 1, ct, PREMUL_SK_ALPHATYPE 18 1, 1, ct, PREMUL_SK_ALPHATYPE
19 }; 19 };
20 uint32_t pixel[1] = { 0 }; 20 uint32_t pixel[1] = { 0 };
21 sk_surfaceprops_t surfaceProps = { UNKNOWN_SK_PIXELGEOMETRY };
21 22
22 sk_surface_t* surface = sk_surface_new_raster_direct(&info, pixel, sizeof(ui nt32_t)); 23 sk_surface_t* surface = sk_surface_new_raster_direct(&info, pixel, sizeof(ui nt32_t),
24 &surfaceProps);
23 sk_paint_t* paint = sk_paint_new(); 25 sk_paint_t* paint = sk_paint_new();
24 26
25 sk_canvas_t* canvas = sk_surface_get_canvas(surface); 27 sk_canvas_t* canvas = sk_surface_get_canvas(surface);
26 sk_canvas_draw_paint(canvas, paint); 28 sk_canvas_draw_paint(canvas, paint);
27 REPORTER_ASSERT(reporter, 0xFF000000 == pixel[0]); 29 REPORTER_ASSERT(reporter, 0xFF000000 == pixel[0]);
28 30
29 sk_paint_set_color(paint, sk_color_set_argb(0xFF, 0xFF, 0xFF, 0xFF)); 31 sk_paint_set_color(paint, sk_color_set_argb(0xFF, 0xFF, 0xFF, 0xFF));
30 sk_canvas_draw_paint(canvas, paint); 32 sk_canvas_draw_paint(canvas, paint);
31 REPORTER_ASSERT(reporter, 0xFFFFFFFF == pixel[0]); 33 REPORTER_ASSERT(reporter, 0xFFFFFFFF == pixel[0]);
32 34
33 sk_paint_delete(paint); 35 sk_paint_delete(paint);
34 sk_surface_unref(surface); 36 sk_surface_unref(surface);
35 } 37 }
36 38
37 DEF_TEST(C_API, reporter) { 39 DEF_TEST(C_API, reporter) {
38 test_c(reporter); 40 test_c(reporter);
39 } 41 }
OLDNEW
« no previous file with comments | « src/utils/SkLua.cpp ('k') | tools/skhello.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698