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

Side by Side Diff: tests/ApplyGammaTest.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 | « src/xps/SkXPSDevice.cpp ('k') | tests/ImageFilterTest.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 2016 Google Inc. 2 * Copyright 2016 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 <initializer_list> 8 #include <initializer_list>
9 #include "Test.h" 9 #include "Test.h"
10 10
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 ERRORF(reporter, "Could not create surfaces for copy surface tes t."); 105 ERRORF(reporter, "Could not create surfaces for copy surface tes t.");
106 continue; 106 continue;
107 } 107 }
108 108
109 SkCanvas* dstCanvas = dst->getCanvas(); 109 SkCanvas* dstCanvas = dst->getCanvas();
110 110
111 dstCanvas->clear(SK_ColorRED); 111 dstCanvas->clear(SK_ColorRED);
112 dstCanvas->flush(); 112 dstCanvas->flush();
113 113
114 SkPaint gammaPaint; 114 SkPaint gammaPaint;
115 gammaPaint.setXfermodeMode(SkXfermode::kSrc_Mode); 115 gammaPaint.setBlendMode(SkBlendMode::kSrc);
116 gammaPaint.setColorFilter(SkGammaColorFilter::Make(gamma)); 116 gammaPaint.setColorFilter(SkGammaColorFilter::Make(gamma));
117 117
118 dstCanvas->drawImage(src, 0, 0, &gammaPaint); 118 dstCanvas->drawImage(src, 0, 0, &gammaPaint);
119 dstCanvas->flush(); 119 dstCanvas->flush();
120 120
121 sk_memset32(read.get(), 0, kW * kH); 121 sk_memset32(read.get(), 0, kW * kH);
122 if (!dstCanvas->readPixels(ii, read.get(), kRowBytes, 0, 0)) { 122 if (!dstCanvas->readPixels(ii, read.get(), kRowBytes, 0, 0)) {
123 ERRORF(reporter, "Error calling readPixels"); 123 ERRORF(reporter, "Error calling readPixels");
124 continue; 124 continue;
125 } 125 }
(...skipping 11 matching lines...) Expand all
137 x, y, expected, s, gamma, r); 137 x, y, expected, s, gamma, r);
138 abort = true; 138 abort = true;
139 break; 139 break;
140 } 140 }
141 } 141 }
142 } 142 }
143 } 143 }
144 } 144 }
145 } 145 }
146 #endif 146 #endif
OLDNEW
« no previous file with comments | « src/xps/SkXPSDevice.cpp ('k') | tests/ImageFilterTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698