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

Side by Side Diff: dm/DMSrcSink.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 | « bench/XfermodeBench.cpp ('k') | fuzz/FilterFuzz.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 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 "DMSrcSink.h" 8 #include "DMSrcSink.h"
9 #include "Resources.h" 9 #include "Resources.h"
10 #include "SkAndroidCodec.h" 10 #include "SkAndroidCodec.h"
(...skipping 1436 matching lines...) Expand 10 before | Expand all | Expand 10 after
1447 upright.setSkewX(SkScalarSignAsScalar(inverse.getSkewX())); 1447 upright.setSkewX(SkScalarSignAsScalar(inverse.getSkewX()));
1448 upright.setSkewY(SkScalarSignAsScalar(inverse.getSkewY())); 1448 upright.setSkewY(SkScalarSignAsScalar(inverse.getSkewY()));
1449 1449
1450 SkBitmap uprighted; 1450 SkBitmap uprighted;
1451 SkISize size = auto_compute_translate(&upright, bitmap->width(), bitmap->hei ght()); 1451 SkISize size = auto_compute_translate(&upright, bitmap->width(), bitmap->hei ght());
1452 uprighted.allocPixels(bitmap->info().makeWH(size.width(), size.height())); 1452 uprighted.allocPixels(bitmap->info().makeWH(size.width(), size.height()));
1453 1453
1454 SkCanvas canvas(uprighted); 1454 SkCanvas canvas(uprighted);
1455 canvas.concat(upright); 1455 canvas.concat(upright);
1456 SkPaint paint; 1456 SkPaint paint;
1457 paint.setXfermodeMode(SkXfermode::kSrc_Mode); 1457 paint.setBlendMode(SkBlendMode::kSrc);
1458 canvas.drawBitmap(*bitmap, 0, 0, &paint); 1458 canvas.drawBitmap(*bitmap, 0, 0, &paint);
1459 1459
1460 *bitmap = uprighted; 1460 *bitmap = uprighted;
1461 bitmap->lockPixels(); 1461 bitmap->lockPixels();
1462 return ""; 1462 return "";
1463 } 1463 }
1464 1464
1465 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~*/ 1465 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~*/
1466 1466
1467 Error ViaSerialization::draw( 1467 Error ViaSerialization::draw(
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
1708 Error err = src.draw(&rec); 1708 Error err = src.draw(&rec);
1709 if (!err.isEmpty()) { 1709 if (!err.isEmpty()) {
1710 return err; 1710 return err;
1711 } 1711 }
1712 dl->draw(canvas); 1712 dl->draw(canvas);
1713 return check_against_reference(bitmap, src, fSink); 1713 return check_against_reference(bitmap, src, fSink);
1714 }); 1714 });
1715 } 1715 }
1716 1716
1717 } // namespace DM 1717 } // namespace DM
OLDNEW
« no previous file with comments | « bench/XfermodeBench.cpp ('k') | fuzz/FilterFuzz.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698