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

Side by Side Diff: gm/transparency.cpp

Issue 842013002: Modify transparency_check GM to always tile correctly. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 11 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 | « no previous file | 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 2015 Google Inc. 2 * Copyright 2015 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 "SkGradientShader.h" 8 #include "SkGradientShader.h"
9 #include "SkSurface.h" 9 #include "SkSurface.h"
10 #include "gm.h" 10 #include "gm.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 static void checkerboard(SkCanvas* canvas, SkColor c1, SkColor c2, int size) { 55 static void checkerboard(SkCanvas* canvas, SkColor c1, SkColor c2, int size) {
56 SkPaint paint; 56 SkPaint paint;
57 paint.setShader(create_checkerboard_shader(c1, c2, size))->unref(); 57 paint.setShader(create_checkerboard_shader(c1, c2, size))->unref();
58 canvas->drawPaint(paint); 58 canvas->drawPaint(paint);
59 } 59 }
60 60
61 /** 61 /**
62 * This GM verifies that a transparent bitmap drawn over a 62 * This GM verifies that a transparent bitmap drawn over a
63 * checkerboard pattern looks correct. 63 * checkerboard pattern looks correct.
64 */ 64 */
65 DEF_SIMPLE_GM(transparency_check, canvas, 1912, 1080) { 65 DEF_SIMPLE_GM(transparency_check, canvas, 1792, 1080) {
66 checkerboard(canvas, 0xFF999999, 0xFF666666, 8); 66 checkerboard(canvas, 0xFF999999, 0xFF666666, 8);
67 { 67 {
68 SkAutoCanvasRestore autoCanvasRestore(canvas, true); 68 SkAutoCanvasRestore autoCanvasRestore(canvas, true);
69 SkAutoTUnref<SkSurface> surface(SkSurface::NewRasterN32Premul(256, 9)); 69 SkAutoTUnref<SkSurface> surface(SkSurface::NewRasterN32Premul(256, 9));
70 make_transparency(surface->getCanvas(), 256.0f, 9.0f); 70 make_transparency(surface->getCanvas(), 256.0f, 9.0f);
71 canvas->scale(7.5f, 120.0f); 71 canvas->scale(7.0f, 120.0f);
72 surface->draw(canvas, 0, 0, NULL); 72 surface->draw(canvas, 0, 0, NULL);
73 } 73 }
74 } 74 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698