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

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

Issue 808703006: remove view matrix from context (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: one more fix Created 6 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 "SkReadBuffer.h" 9 #include "SkReadBuffer.h"
10 #include "SkWriteBuffer.h" 10 #include "SkWriteBuffer.h"
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 425
426 paint.addColorProcessor( 426 paint.addColorProcessor(
427 GrDisplacementMapEffect::Create(fXChannelSelector, 427 GrDisplacementMapEffect::Create(fXChannelSelector,
428 fYChannelSelector, 428 fYChannelSelector,
429 scale, 429 scale,
430 displacement, 430 displacement,
431 offsetMatrix, 431 offsetMatrix,
432 color))->unref(); 432 color))->unref();
433 SkIRect colorBounds = bounds; 433 SkIRect colorBounds = bounds;
434 colorBounds.offset(-colorOffset); 434 colorBounds.offset(-colorOffset);
435 GrContext::AutoMatrix am;
436 am.setIdentity(context);
437 SkMatrix matrix; 435 SkMatrix matrix;
438 matrix.setTranslate(-SkIntToScalar(colorBounds.x()), 436 matrix.setTranslate(-SkIntToScalar(colorBounds.x()),
439 -SkIntToScalar(colorBounds.y())); 437 -SkIntToScalar(colorBounds.y()));
440 context->concatMatrix(matrix); 438 context->drawRect(paint, matrix, SkRect::Make(colorBounds));
441 context->drawRect(paint, SkRect::Make(colorBounds));
442 offset->fX = bounds.left(); 439 offset->fX = bounds.left();
443 offset->fY = bounds.top(); 440 offset->fY = bounds.top();
444 WrapTexture(dst, bounds.width(), bounds.height(), result); 441 WrapTexture(dst, bounds.width(), bounds.height(), result);
445 return true; 442 return true;
446 } 443 }
447 444
448 /////////////////////////////////////////////////////////////////////////////// 445 ///////////////////////////////////////////////////////////////////////////////
449 446
450 GrDisplacementMapEffect::GrDisplacementMapEffect( 447 GrDisplacementMapEffect::GrDisplacementMapEffect(
451 SkDisplacementMapEffect::ChannelSelectorType xChann elSelector, 448 SkDisplacementMapEffect::ChannelSelectorType xChann elSelector,
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
616 void GrGLDisplacementMapEffect::GenKey(const GrProcessor& proc, 613 void GrGLDisplacementMapEffect::GenKey(const GrProcessor& proc,
617 const GrGLCaps&, GrProcessorKeyBuilder* b ) { 614 const GrGLCaps&, GrProcessorKeyBuilder* b ) {
618 const GrDisplacementMapEffect& displacementMap = proc.cast<GrDisplacementMap Effect>(); 615 const GrDisplacementMapEffect& displacementMap = proc.cast<GrDisplacementMap Effect>();
619 616
620 uint32_t xKey = displacementMap.xChannelSelector(); 617 uint32_t xKey = displacementMap.xChannelSelector();
621 uint32_t yKey = displacementMap.yChannelSelector() << kChannelSelectorKeyBit s; 618 uint32_t yKey = displacementMap.yChannelSelector() << kChannelSelectorKeyBit s;
622 619
623 b->add32(xKey | yKey); 620 b->add32(xKey | yKey);
624 } 621 }
625 #endif 622 #endif
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