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

Side by Side Diff: src/effects/SkXfermodeImageFilter.cpp

Issue 777643003: use ClipOp instead of SkRegion for clipping (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years 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/core/SkRecordDraw.cpp ('k') | src/pipe/SkGPipeRead.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 2013 The Android Open Source Project 2 * Copyright 2013 The Android Open Source Project
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 "SkXfermodeImageFilter.h" 8 #include "SkXfermodeImageFilter.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkDevice.h" 10 #include "SkDevice.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 } 82 }
83 SkCanvas canvas(device); 83 SkCanvas canvas(device);
84 canvas.translate(SkIntToScalar(-bounds.left()), SkIntToScalar(-bounds.top()) ); 84 canvas.translate(SkIntToScalar(-bounds.left()), SkIntToScalar(-bounds.top()) );
85 SkPaint paint; 85 SkPaint paint;
86 paint.setXfermodeMode(SkXfermode::kSrc_Mode); 86 paint.setXfermodeMode(SkXfermode::kSrc_Mode);
87 canvas.drawBitmap(background, SkIntToScalar(backgroundOffset.fX), 87 canvas.drawBitmap(background, SkIntToScalar(backgroundOffset.fX),
88 SkIntToScalar(backgroundOffset.fY), &paint); 88 SkIntToScalar(backgroundOffset.fY), &paint);
89 paint.setXfermode(fMode); 89 paint.setXfermode(fMode);
90 canvas.drawBitmap(foreground, SkIntToScalar(foregroundOffset.fX), 90 canvas.drawBitmap(foreground, SkIntToScalar(foregroundOffset.fX),
91 SkIntToScalar(foregroundOffset.fY), &paint); 91 SkIntToScalar(foregroundOffset.fY), &paint);
92 canvas.clipRect(SkRect::Make(foregroundBounds), SkRegion::kDifference_Op); 92 canvas.clipRect(SkRect::Make(foregroundBounds), kDifference_SkClipOp);
93 paint.setColor(SK_ColorTRANSPARENT); 93 paint.setColor(SK_ColorTRANSPARENT);
94 canvas.drawPaint(paint); 94 canvas.drawPaint(paint);
95 *dst = device->accessBitmap(false); 95 *dst = device->accessBitmap(false);
96 offset->fX = bounds.left(); 96 offset->fX = bounds.left();
97 offset->fY = bounds.top(); 97 offset->fY = bounds.top();
98 return true; 98 return true;
99 } 99 }
100 100
101 #if SK_SUPPORT_GPU 101 #if SK_SUPPORT_GPU
102 102
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 paint.addColorProcessor(xferProcessor)->unref(); 158 paint.addColorProcessor(xferProcessor)->unref();
159 context->drawRect(paint, srcRect); 159 context->drawRect(paint, srcRect);
160 160
161 offset->fX = backgroundOffset.fX; 161 offset->fX = backgroundOffset.fX;
162 offset->fY = backgroundOffset.fY; 162 offset->fY = backgroundOffset.fY;
163 WrapTexture(dst, src.width(), src.height(), result); 163 WrapTexture(dst, src.width(), src.height(), result);
164 return true; 164 return true;
165 } 165 }
166 166
167 #endif 167 #endif
OLDNEW
« no previous file with comments | « src/core/SkRecordDraw.cpp ('k') | src/pipe/SkGPipeRead.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698