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

Side by Side Diff: gm/bitmaprect.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 | « gm/aaxfermodes.cpp ('k') | gm/blurredclippedcircle.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 2011 Google Inc. 2 * Copyright 2011 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 "gm.h" 8 #include "gm.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkGradientShader.h" 10 #include "SkGradientShader.h"
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 return SkISize::Make(640, 480); 194 return SkISize::Make(640, 480);
195 } 195 }
196 196
197 void onOnceBeforeDraw() override { 197 void onOnceBeforeDraw() override {
198 make_big_bitmap(&fBigBitmap); 198 make_big_bitmap(&fBigBitmap);
199 } 199 }
200 200
201 void onDraw(SkCanvas* canvas) override { 201 void onDraw(SkCanvas* canvas) override {
202 SkPaint paint; 202 SkPaint paint;
203 paint.setAlpha(128); 203 paint.setAlpha(128);
204 paint.setXfermode(SkXfermode::Make(SkXfermode::kXor_Mode)); 204 paint.setBlendMode(SkBlendMode::kXor);
205 205
206 SkRect srcR1 = { 0.0f, 0.0f, 4096.0f, 2040.0f }; 206 SkRect srcR1 = { 0.0f, 0.0f, 4096.0f, 2040.0f };
207 SkRect dstR1 = { 10.1f, 10.1f, 629.9f, 400.9f }; 207 SkRect dstR1 = { 10.1f, 10.1f, 629.9f, 400.9f };
208 208
209 SkRect srcR2 = { 4085.0f, 10.0f, 4087.0f, 12.0f }; 209 SkRect srcR2 = { 4085.0f, 10.0f, 4087.0f, 12.0f };
210 SkRect dstR2 = { 10, 410, 30, 430 }; 210 SkRect dstR2 = { 10, 410, 30, 430 };
211 211
212 if (!fUseIRect) { 212 if (!fUseIRect) {
213 canvas->drawBitmapRect(fBigBitmap, srcR1, dstR1, &paint, 213 canvas->drawBitmapRect(fBigBitmap, srcR1, dstR1, &paint,
214 SkCanvas::kStrict_SrcRectConstraint); 214 SkCanvas::kStrict_SrcRectConstraint);
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 ////////////////////////////////////////////////////////////////////////////// 271 //////////////////////////////////////////////////////////////////////////////
272 272
273 DEF_GM( return new DrawBitmapRect2(false); ) 273 DEF_GM( return new DrawBitmapRect2(false); )
274 DEF_GM( return new DrawBitmapRect2(true); ) 274 DEF_GM( return new DrawBitmapRect2(true); )
275 DEF_GM( return new DrawBitmapRect3(); ) 275 DEF_GM( return new DrawBitmapRect3(); )
276 276
277 #ifndef SK_BUILD_FOR_ANDROID 277 #ifndef SK_BUILD_FOR_ANDROID
278 DEF_GM( return new DrawBitmapRect4(false); ) 278 DEF_GM( return new DrawBitmapRect4(false); )
279 DEF_GM( return new DrawBitmapRect4(true); ) 279 DEF_GM( return new DrawBitmapRect4(true); )
280 #endif 280 #endif
OLDNEW
« no previous file with comments | « gm/aaxfermodes.cpp ('k') | gm/blurredclippedcircle.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698