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

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

Issue 1404823005: GrDrawContext now holds GrRenderTarget pointer (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix overlength line Created 5 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/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 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 displacement, 442 displacement,
443 offsetMatrix, 443 offsetMatrix,
444 color, 444 color,
445 colorBM.dimensions()))->unref(); 445 colorBM.dimensions()))->unref();
446 SkIRect colorBounds = bounds; 446 SkIRect colorBounds = bounds;
447 colorBounds.offset(-colorOffset); 447 colorBounds.offset(-colorOffset);
448 SkMatrix matrix; 448 SkMatrix matrix;
449 matrix.setTranslate(-SkIntToScalar(colorBounds.x()), 449 matrix.setTranslate(-SkIntToScalar(colorBounds.x()),
450 -SkIntToScalar(colorBounds.y())); 450 -SkIntToScalar(colorBounds.y()));
451 451
452 SkAutoTUnref<GrDrawContext> drawContext(context->drawContext()); 452 SkAutoTUnref<GrDrawContext> drawContext(context->drawContext(dst->asRenderTa rget()));
453 if (!drawContext) { 453 if (!drawContext) {
454 return false; 454 return false;
455 } 455 }
456 456
457 drawContext->drawRect(dst->asRenderTarget(), GrClip::WideOpen(), paint, matr ix, 457 drawContext->drawRect(GrClip::WideOpen(), paint, matrix, SkRect::Make(colorB ounds));
458 SkRect::Make(colorBounds));
459 offset->fX = bounds.left(); 458 offset->fX = bounds.left();
460 offset->fY = bounds.top(); 459 offset->fY = bounds.top();
461 WrapTexture(dst, bounds.width(), bounds.height(), result); 460 WrapTexture(dst, bounds.width(), bounds.height(), result);
462 return true; 461 return true;
463 } 462 }
464 463
465 /////////////////////////////////////////////////////////////////////////////// 464 ///////////////////////////////////////////////////////////////////////////////
466 465
467 GrDisplacementMapEffect::GrDisplacementMapEffect( 466 GrDisplacementMapEffect::GrDisplacementMapEffect(
468 SkDisplacementMapEffect::ChannelSelectorType xChann elSelector, 467 SkDisplacementMapEffect::ChannelSelectorType xChann elSelector,
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 const GrGLSLCaps&, GrProcessorKeyBuilder* b) { 626 const GrGLSLCaps&, GrProcessorKeyBuilder* b) {
628 const GrDisplacementMapEffect& displacementMap = proc.cast<GrDisplacementMap Effect>(); 627 const GrDisplacementMapEffect& displacementMap = proc.cast<GrDisplacementMap Effect>();
629 628
630 uint32_t xKey = displacementMap.xChannelSelector(); 629 uint32_t xKey = displacementMap.xChannelSelector();
631 uint32_t yKey = displacementMap.yChannelSelector() << kChannelSelectorKeyBit s; 630 uint32_t yKey = displacementMap.yChannelSelector() << kChannelSelectorKeyBit s;
632 631
633 b->add32(xKey | yKey); 632 b->add32(xKey | yKey);
634 } 633 }
635 #endif 634 #endif
636 635
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