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

Side by Side Diff: tools/sk_tool_utils.cpp

Issue 2396953002: Revert[8] "replace SkXfermode obj with SkBlendMode enum in paints" (Closed)
Patch Set: add tmp virtual to unroll legacy arithmodes Created 4 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 | « tools/debugger/SkDrawCommand.cpp ('k') | tools/viewer/sk_app/mac/RasterWindowContext_mac.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_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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 bitmap.allocPixels(SkImageInfo::MakeS32(w, h, kPremul_SkAlphaType)); 213 bitmap.allocPixels(SkImageInfo::MakeS32(w, h, kPremul_SkAlphaType));
214 SkCanvas canvas(bitmap); 214 SkCanvas canvas(bitmap);
215 215
216 sk_tool_utils::draw_checkerboard(&canvas, c1, c2, checkSize); 216 sk_tool_utils::draw_checkerboard(&canvas, c1, c2, checkSize);
217 return bitmap; 217 return bitmap;
218 } 218 }
219 219
220 void draw_checkerboard(SkCanvas* canvas, SkColor c1, SkColor c2, int size) { 220 void draw_checkerboard(SkCanvas* canvas, SkColor c1, SkColor c2, int size) {
221 SkPaint paint; 221 SkPaint paint;
222 paint.setShader(create_checkerboard_shader(c1, c2, size)); 222 paint.setShader(create_checkerboard_shader(c1, c2, size));
223 paint.setXfermodeMode(SkXfermode::kSrc_Mode); 223 paint.setBlendMode(SkBlendMode::kSrc);
224 canvas->drawPaint(paint); 224 canvas->drawPaint(paint);
225 } 225 }
226 226
227 SkBitmap create_string_bitmap(int w, int h, SkColor c, int x, int y, 227 SkBitmap create_string_bitmap(int w, int h, SkColor c, int x, int y,
228 int textSize, const char* str) { 228 int textSize, const char* str) {
229 SkBitmap bitmap; 229 SkBitmap bitmap;
230 bitmap.allocN32Pixels(w, h); 230 bitmap.allocN32Pixels(w, h);
231 SkCanvas canvas(bitmap); 231 SkCanvas canvas(bitmap);
232 232
233 SkPaint paint; 233 SkPaint paint;
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 const SkVector& ll = rr.radii(SkRRect::kLowerLeft_Corner); 539 const SkVector& ll = rr.radii(SkRRect::kLowerLeft_Corner);
540 540
541 SkScalar maxL = SkTMax(ul.fX, ll.fX); 541 SkScalar maxL = SkTMax(ul.fX, ll.fX);
542 SkScalar maxR = SkTMax(ur.fX, lr.fX); 542 SkScalar maxR = SkTMax(ur.fX, lr.fX);
543 543
544 return SkRect::MakeLTRB(r.fLeft + maxL, r.fTop, r.fRight - maxR, r.fBottom); 544 return SkRect::MakeLTRB(r.fLeft + maxL, r.fTop, r.fRight - maxR, r.fBottom);
545 } 545 }
546 546
547 547
548 } // namespace sk_tool_utils 548 } // namespace sk_tool_utils
OLDNEW
« no previous file with comments | « tools/debugger/SkDrawCommand.cpp ('k') | tools/viewer/sk_app/mac/RasterWindowContext_mac.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698