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

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

Issue 936943002: Pass clip to context (Closed) Base URL: https://skia.googlesource.com/skia.git@pass_down_rendertarget
Patch Set: feedback inc Created 5 years, 9 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
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 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 fYChannelSelector, 442 fYChannelSelector,
443 scale, 443 scale,
444 displacement, 444 displacement,
445 offsetMatrix, 445 offsetMatrix,
446 color))->unref(); 446 color))->unref();
447 SkIRect colorBounds = bounds; 447 SkIRect colorBounds = bounds;
448 colorBounds.offset(-colorOffset); 448 colorBounds.offset(-colorOffset);
449 SkMatrix matrix; 449 SkMatrix matrix;
450 matrix.setTranslate(-SkIntToScalar(colorBounds.x()), 450 matrix.setTranslate(-SkIntToScalar(colorBounds.x()),
451 -SkIntToScalar(colorBounds.y())); 451 -SkIntToScalar(colorBounds.y()));
452 context->drawRect(dst->asRenderTarget(), paint, matrix, SkRect::Make(colorBo unds)); 452 context->drawRect(dst->asRenderTarget(), GrClip::WideOpen(), paint, matrix,
453 SkRect::Make(colorBounds));
453 offset->fX = bounds.left(); 454 offset->fX = bounds.left();
454 offset->fY = bounds.top(); 455 offset->fY = bounds.top();
455 WrapTexture(dst, bounds.width(), bounds.height(), result); 456 WrapTexture(dst, bounds.width(), bounds.height(), result);
456 return true; 457 return true;
457 } 458 }
458 459
459 /////////////////////////////////////////////////////////////////////////////// 460 ///////////////////////////////////////////////////////////////////////////////
460 461
461 GrDisplacementMapEffect::GrDisplacementMapEffect( 462 GrDisplacementMapEffect::GrDisplacementMapEffect(
462 SkDisplacementMapEffect::ChannelSelectorType xChann elSelector, 463 SkDisplacementMapEffect::ChannelSelectorType xChann elSelector,
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
630 const GrGLCaps&, GrProcessorKeyBuilder* b ) { 631 const GrGLCaps&, GrProcessorKeyBuilder* b ) {
631 const GrDisplacementMapEffect& displacementMap = proc.cast<GrDisplacementMap Effect>(); 632 const GrDisplacementMapEffect& displacementMap = proc.cast<GrDisplacementMap Effect>();
632 633
633 uint32_t xKey = displacementMap.xChannelSelector(); 634 uint32_t xKey = displacementMap.xChannelSelector();
634 uint32_t yKey = displacementMap.yChannelSelector() << kChannelSelectorKeyBit s; 635 uint32_t yKey = displacementMap.yChannelSelector() << kChannelSelectorKeyBit s;
635 636
636 b->add32(xKey | yKey); 637 b->add32(xKey | yKey);
637 } 638 }
638 #endif 639 #endif
639 640
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698