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

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

Issue 1918003003: Bring sk_sp to GrDrawContext (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update Created 4 years, 8 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
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 9
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 // A null 'xferFP' here means kSrc_Mode was used in which case we can ju st proceed 241 // A null 'xferFP' here means kSrc_Mode was used in which case we can ju st proceed
242 if (xferFP) { 242 if (xferFP) {
243 paint.addColorFragmentProcessor(xferFP); 243 paint.addColorFragmentProcessor(xferFP);
244 } 244 }
245 } else { 245 } else {
246 paint.addColorFragmentProcessor(bgFP); 246 paint.addColorFragmentProcessor(bgFP);
247 } 247 }
248 248
249 paint.setPorterDuffXPFactory(SkXfermode::kSrc_Mode); 249 paint.setPorterDuffXPFactory(SkXfermode::kSrc_Mode);
250 250
251 SkAutoTUnref<GrDrawContext> drawContext(context->drawContext(dst->asRenderTa rget())); 251 sk_sp<GrDrawContext> drawContext(context->drawContext(sk_ref_sp(dst->asRende rTarget())));
252 if (!drawContext) { 252 if (!drawContext) {
253 return nullptr; 253 return nullptr;
254 } 254 }
255 255
256 SkMatrix matrix; 256 SkMatrix matrix;
257 matrix.setTranslate(SkIntToScalar(-bounds.left()), SkIntToScalar(-bounds.top ())); 257 matrix.setTranslate(SkIntToScalar(-bounds.left()), SkIntToScalar(-bounds.top ()));
258 drawContext->drawRect(GrClip::WideOpen(), paint, matrix, SkRect::Make(bounds )); 258 drawContext->drawRect(GrClip::WideOpen(), paint, matrix, SkRect::Make(bounds ));
259 259
260 return SkSpecialImage::MakeFromGpu(SkIRect::MakeWH(bounds.width(), bounds.he ight()), 260 return SkSpecialImage::MakeFromGpu(SkIRect::MakeWH(bounds.width(), bounds.he ight()),
261 kNeedNewImageUniqueID_SpecialImage, 261 kNeedNewImageUniqueID_SpecialImage,
262 std::move(dst)); 262 std::move(dst));
263 } 263 }
264 264
265 #endif 265 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698