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

Side by Side Diff: src/core/SkImageFilter.cpp

Issue 2041113004: sk_sp for gpu. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Reserve correctly. Created 4 years, 6 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/core/SkComposeShader.cpp ('k') | src/core/SkLightingShader.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 2012 The Android Open Source Project 2 * Copyright 2012 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 "SkImageFilter.h" 8 #include "SkImageFilter.h"
9 9
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 } 270 }
271 } 271 }
272 return true; 272 return true;
273 } 273 }
274 274
275 #if SK_SUPPORT_GPU 275 #if SK_SUPPORT_GPU
276 sk_sp<SkSpecialImage> SkImageFilter::DrawWithFP(GrContext* context, 276 sk_sp<SkSpecialImage> SkImageFilter::DrawWithFP(GrContext* context,
277 sk_sp<GrFragmentProcessor> fp, 277 sk_sp<GrFragmentProcessor> fp,
278 const SkIRect& bounds) { 278 const SkIRect& bounds) {
279 GrPaint paint; 279 GrPaint paint;
280 paint.addColorFragmentProcessor(fp.get()); 280 paint.addColorFragmentProcessor(std::move(fp));
281 paint.setPorterDuffXPFactory(SkXfermode::kSrc_Mode); 281 paint.setPorterDuffXPFactory(SkXfermode::kSrc_Mode);
282 282
283 sk_sp<GrDrawContext> drawContext(context->newDrawContext(SkBackingFit::kAppr ox, 283 sk_sp<GrDrawContext> drawContext(context->newDrawContext(SkBackingFit::kAppr ox,
284 bounds.width(), bou nds.height(), 284 bounds.width(), bou nds.height(),
285 kRGBA_8888_GrPixelC onfig)); 285 kRGBA_8888_GrPixelC onfig));
286 if (!drawContext) { 286 if (!drawContext) {
287 return nullptr; 287 return nullptr;
288 } 288 }
289 289
290 SkIRect dstIRect = SkIRect::MakeWH(bounds.width(), bounds.height()); 290 SkIRect dstIRect = SkIRect::MakeWH(bounds.width(), bounds.height());
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 sk_sp<SkSpecialImage> result(input->filterImage(src, this->mapContext(ctx), offset)); 439 sk_sp<SkSpecialImage> result(input->filterImage(src, this->mapContext(ctx), offset));
440 440
441 SkASSERT(!result || src->isTextureBacked() == result->isTextureBacked()); 441 SkASSERT(!result || src->isTextureBacked() == result->isTextureBacked());
442 442
443 return result; 443 return result;
444 } 444 }
445 445
446 void SkImageFilter::PurgeCache() { 446 void SkImageFilter::PurgeCache() {
447 SkImageFilterCache::Get()->purge(); 447 SkImageFilterCache::Get()->purge();
448 } 448 }
OLDNEW
« no previous file with comments | « src/core/SkComposeShader.cpp ('k') | src/core/SkLightingShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698