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

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

Issue 1471053002: Don't create a GXPFactory when blend is SrcOver (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix compile Created 5 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/effects/SkBlurMaskFilter.cpp ('k') | src/effects/SkGpuBlurUtils.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 Google Inc. 2 * Copyright 2013 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 "SkDisplacementMapEffect.h" 8 #include "SkDisplacementMapEffect.h"
9 #include "SkDevice.h" 9 #include "SkDevice.h"
10 #include "SkReadBuffer.h" 10 #include "SkReadBuffer.h"
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 SkIntToScalar(colorOffset.fY - displacementOffset. fY)); 438 SkIntToScalar(colorOffset.fY - displacementOffset. fY));
439 439
440 paint.addColorFragmentProcessor( 440 paint.addColorFragmentProcessor(
441 GrDisplacementMapEffect::Create(fXChannelSelector, 441 GrDisplacementMapEffect::Create(fXChannelSelector,
442 fYChannelSelector, 442 fYChannelSelector,
443 scale, 443 scale,
444 displacement, 444 displacement,
445 offsetMatrix, 445 offsetMatrix,
446 color, 446 color,
447 colorBM.dimensions()))->unref(); 447 colorBM.dimensions()))->unref();
448 paint.setPorterDuffXPFactory(SkXfermode::kSrc_Mode);
448 SkIRect colorBounds = bounds; 449 SkIRect colorBounds = bounds;
449 colorBounds.offset(-colorOffset); 450 colorBounds.offset(-colorOffset);
450 SkMatrix matrix; 451 SkMatrix matrix;
451 matrix.setTranslate(-SkIntToScalar(colorBounds.x()), 452 matrix.setTranslate(-SkIntToScalar(colorBounds.x()),
452 -SkIntToScalar(colorBounds.y())); 453 -SkIntToScalar(colorBounds.y()));
453 454
454 SkAutoTUnref<GrDrawContext> drawContext(context->drawContext(dst->asRenderTa rget())); 455 SkAutoTUnref<GrDrawContext> drawContext(context->drawContext(dst->asRenderTa rget()));
455 if (!drawContext) { 456 if (!drawContext) {
456 return false; 457 return false;
457 } 458 }
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
633 const GrGLSLCaps&, GrProcessorKeyBuilder* b) { 634 const GrGLSLCaps&, GrProcessorKeyBuilder* b) {
634 const GrDisplacementMapEffect& displacementMap = proc.cast<GrDisplacementMap Effect>(); 635 const GrDisplacementMapEffect& displacementMap = proc.cast<GrDisplacementMap Effect>();
635 636
636 uint32_t xKey = displacementMap.xChannelSelector(); 637 uint32_t xKey = displacementMap.xChannelSelector();
637 uint32_t yKey = displacementMap.yChannelSelector() << kChannelSelectorKeyBit s; 638 uint32_t yKey = displacementMap.yChannelSelector() << kChannelSelectorKeyBit s;
638 639
639 b->add32(xKey | yKey); 640 b->add32(xKey | yKey);
640 } 641 }
641 #endif 642 #endif
642 643
OLDNEW
« no previous file with comments | « src/effects/SkBlurMaskFilter.cpp ('k') | src/effects/SkGpuBlurUtils.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698