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

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

Issue 1944953002: Revert of Add Gr*Proxy classes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 7 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 | « include/private/GrTextureProxy.h ('k') | src/effects/SkAlphaThresholdFilter.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 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(fp.get());
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(GrContext::kLoose_B ackingFit,
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 SkRect srcRect = SkRect::Make(bounds); 290 SkRect srcRect = SkRect::Make(bounds);
291 SkRect dstRect = SkRect::MakeWH(srcRect.width(), srcRect.height()); 291 SkRect dstRect = SkRect::MakeWH(srcRect.width(), srcRect.height());
292 GrClip clip(dstRect); 292 GrClip clip(dstRect);
293 drawContext->fillRectToRect(clip, paint, SkMatrix::I(), dstRect, srcRect); 293 drawContext->fillRectToRect(clip, paint, SkMatrix::I(), dstRect, srcRect);
(...skipping 145 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 | « include/private/GrTextureProxy.h ('k') | src/effects/SkAlphaThresholdFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698