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

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

Issue 2396953002: Revert[8] "replace SkXfermode obj with SkBlendMode enum in paints" (Closed)
Patch Set: add tmp virtual to unroll legacy arithmodes Created 4 years, 2 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/effects/SkColorFilterImageFilter.cpp ('k') | src/effects/SkDropShadowImageFilter.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 9
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 SkIntToScalar(colorOffset.fY - displOffset.fY) ); 336 SkIntToScalar(colorOffset.fY - displOffset.fY) );
337 337
338 paint.addColorFragmentProcessor( 338 paint.addColorFragmentProcessor(
339 GrDisplacementMapEffect::Make(fXChannelSelector, 339 GrDisplacementMapEffect::Make(fXChannelSelector,
340 fYChannelSelector, 340 fYChannelSelector,
341 scale, 341 scale,
342 displTexture.get(), 342 displTexture.get(),
343 offsetMatrix, 343 offsetMatrix,
344 colorTexture.get(), 344 colorTexture.get(),
345 SkISize::Make(color->width(), color->h eight()))); 345 SkISize::Make(color->width(), color->h eight())));
346 paint.setPorterDuffXPFactory(SkXfermode::kSrc_Mode); 346 paint.setPorterDuffXPFactory(SkBlendMode::kSrc);
347 SkMatrix matrix; 347 SkMatrix matrix;
348 matrix.setTranslate(-SkIntToScalar(colorBounds.x()), -SkIntToScalar(colo rBounds.y())); 348 matrix.setTranslate(-SkIntToScalar(colorBounds.x()), -SkIntToScalar(colo rBounds.y()));
349 349
350 SkColorSpace* colorSpace = ctx.outputProperties().colorSpace(); 350 SkColorSpace* colorSpace = ctx.outputProperties().colorSpace();
351 sk_sp<GrDrawContext> drawContext( 351 sk_sp<GrDrawContext> drawContext(
352 context->makeDrawContext(SkBackingFit::kApprox, bounds.width(), boun ds.height(), 352 context->makeDrawContext(SkBackingFit::kApprox, bounds.width(), boun ds.height(),
353 GrRenderableConfigForColorSpace(colorSpace) , 353 GrRenderableConfigForColorSpace(colorSpace) ,
354 sk_ref_sp(colorSpace))); 354 sk_ref_sp(colorSpace)));
355 if (!drawContext) { 355 if (!drawContext) {
356 return nullptr; 356 return nullptr;
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
632 void GrGLDisplacementMapEffect::GenKey(const GrProcessor& proc, 632 void GrGLDisplacementMapEffect::GenKey(const GrProcessor& proc,
633 const GrGLSLCaps&, GrProcessorKeyBuilder* b) { 633 const GrGLSLCaps&, GrProcessorKeyBuilder* b) {
634 const GrDisplacementMapEffect& displacementMap = proc.cast<GrDisplacementMap Effect>(); 634 const GrDisplacementMapEffect& displacementMap = proc.cast<GrDisplacementMap Effect>();
635 635
636 uint32_t xKey = displacementMap.xChannelSelector(); 636 uint32_t xKey = displacementMap.xChannelSelector();
637 uint32_t yKey = displacementMap.yChannelSelector() << kChannelSelectorKeyBit s; 637 uint32_t yKey = displacementMap.yChannelSelector() << kChannelSelectorKeyBit s;
638 638
639 b->add32(xKey | yKey); 639 b->add32(xKey | yKey);
640 } 640 }
641 #endif 641 #endif
OLDNEW
« no previous file with comments | « src/effects/SkColorFilterImageFilter.cpp ('k') | src/effects/SkDropShadowImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698