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

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

Issue 1413673002: Remove DrawingMgr shims from GrContext (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove abandon, reset & flush from public DrawingMgr API 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
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 429 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 displacement, 440 displacement,
441 offsetMatrix, 441 offsetMatrix,
442 color, 442 color,
443 colorBM.dimensions()))->unref(); 443 colorBM.dimensions()))->unref();
444 SkIRect colorBounds = bounds; 444 SkIRect colorBounds = bounds;
445 colorBounds.offset(-colorOffset); 445 colorBounds.offset(-colorOffset);
446 SkMatrix matrix; 446 SkMatrix matrix;
447 matrix.setTranslate(-SkIntToScalar(colorBounds.x()), 447 matrix.setTranslate(-SkIntToScalar(colorBounds.x()),
448 -SkIntToScalar(colorBounds.y())); 448 -SkIntToScalar(colorBounds.y()));
449 449
450 SkAutoTUnref<GrDrawContext> drawContext(context->drawContext(dst->asRenderTa rget())); 450 SkAutoTUnref<GrDrawContext> drawContext(
451 context->drawingMgr().drawContext(dst->asRen derTarget()));
451 if (!drawContext) { 452 if (!drawContext) {
452 return false; 453 return false;
453 } 454 }
454 455
455 drawContext->drawRect(GrClip::WideOpen(), paint, matrix, SkRect::Make(colorB ounds)); 456 drawContext->drawRect(GrClip::WideOpen(), paint, matrix, SkRect::Make(colorB ounds));
456 offset->fX = bounds.left(); 457 offset->fX = bounds.left();
457 offset->fY = bounds.top(); 458 offset->fY = bounds.top();
458 WrapTexture(dst, bounds.width(), bounds.height(), result); 459 WrapTexture(dst, bounds.width(), bounds.height(), result);
459 return true; 460 return true;
460 } 461 }
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
624 const GrGLSLCaps&, GrProcessorKeyBuilder* b) { 625 const GrGLSLCaps&, GrProcessorKeyBuilder* b) {
625 const GrDisplacementMapEffect& displacementMap = proc.cast<GrDisplacementMap Effect>(); 626 const GrDisplacementMapEffect& displacementMap = proc.cast<GrDisplacementMap Effect>();
626 627
627 uint32_t xKey = displacementMap.xChannelSelector(); 628 uint32_t xKey = displacementMap.xChannelSelector();
628 uint32_t yKey = displacementMap.yChannelSelector() << kChannelSelectorKeyBit s; 629 uint32_t yKey = displacementMap.yChannelSelector() << kChannelSelectorKeyBit s;
629 630
630 b->add32(xKey | yKey); 631 b->add32(xKey | yKey);
631 } 632 }
632 #endif 633 #endif
633 634
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698