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

Side by Side Diff: tools/sk_tool_utils.cpp

Issue 877103002: sk_tool_utils::draw_checkerboard uses SkXfermode::kSrc_Mode to fix valgrind error. (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 | « tools/sk_tool_utils.h ('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 "sk_tool_utils.h" 8 #include "sk_tool_utils.h"
9 #include "sk_tool_utils_flags.h" 9 #include "sk_tool_utils_flags.h"
10 10
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 bm.eraseColor(c1); 66 bm.eraseColor(c1);
67 bm.eraseArea(SkIRect::MakeLTRB(0, 0, size, size), c2); 67 bm.eraseArea(SkIRect::MakeLTRB(0, 0, size, size), c2);
68 bm.eraseArea(SkIRect::MakeLTRB(size, size, 2 * size, 2 * size), c2); 68 bm.eraseArea(SkIRect::MakeLTRB(size, size, 2 * size, 2 * size), c2);
69 return SkShader::CreateBitmapShader( 69 return SkShader::CreateBitmapShader(
70 bm, SkShader::kRepeat_TileMode, SkShader::kRepeat_TileMode); 70 bm, SkShader::kRepeat_TileMode, SkShader::kRepeat_TileMode);
71 } 71 }
72 72
73 void draw_checkerboard(SkCanvas* canvas, SkColor c1, SkColor c2, int size) { 73 void draw_checkerboard(SkCanvas* canvas, SkColor c1, SkColor c2, int size) {
74 SkPaint paint; 74 SkPaint paint;
75 paint.setShader(create_checkerboard_shader(c1, c2, size))->unref(); 75 paint.setShader(create_checkerboard_shader(c1, c2, size))->unref();
76 paint.setXfermodeMode(SkXfermode::kSrc_Mode);
76 canvas->drawPaint(paint); 77 canvas->drawPaint(paint);
77 } 78 }
78 79
79 } // namespace sk_tool_utils 80 } // namespace sk_tool_utils
OLDNEW
« no previous file with comments | « tools/sk_tool_utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698