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

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

Issue 143073008: add installPixels (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rebase Created 6 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « src/effects/SkBlurImageFilter.cpp ('k') | src/effects/SkLightingImageFilter.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 "SkFlattenableBuffers.h" 9 #include "SkFlattenableBuffers.h"
10 #include "SkUnPreMultiply.h" 10 #include "SkUnPreMultiply.h"
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 displ.getBounds(&displBounds); 222 displ.getBounds(&displBounds);
223 displBounds.offset(displOffset); 223 displBounds.offset(displOffset);
224 if (!this->applyCropRect(&displBounds, ctm)) { 224 if (!this->applyCropRect(&displBounds, ctm)) {
225 return false; 225 return false;
226 } 226 }
227 if (!bounds.intersect(displBounds)) { 227 if (!bounds.intersect(displBounds)) {
228 return false; 228 return false;
229 } 229 }
230 230
231 dst->setConfig(color.config(), bounds.width(), bounds.height()); 231 dst->setConfig(color.config(), bounds.width(), bounds.height());
232 dst->allocPixels(); 232 if (!dst->allocPixels()) {
233 if (!dst->getPixels()) {
234 return false; 233 return false;
235 } 234 }
236 235
237 SkVector scale = SkVector::Make(fScale, fScale); 236 SkVector scale = SkVector::Make(fScale, fScale);
238 ctm.mapVectors(&scale, 1); 237 ctm.mapVectors(&scale, 1);
239 SkIRect colorBounds = bounds; 238 SkIRect colorBounds = bounds;
240 colorBounds.offset(-colorOffset); 239 colorBounds.offset(-colorOffset);
241 240
242 computeDisplacement(fXChannelSelector, fYChannelSelector, scale, dst, 241 computeDisplacement(fXChannelSelector, fYChannelSelector, scale, dst,
243 &displ, colorOffset - displOffset, &color, colorBounds); 242 &displ, colorOffset - displOffset, &color, colorBounds);
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 const GrGLCaps&) { 581 const GrGLCaps&) {
583 const GrDisplacementMapEffect& displacementMap = 582 const GrDisplacementMapEffect& displacementMap =
584 drawEffect.castEffect<GrDisplacementMapEffect>(); 583 drawEffect.castEffect<GrDisplacementMapEffect>();
585 584
586 EffectKey xKey = displacementMap.xChannelSelector(); 585 EffectKey xKey = displacementMap.xChannelSelector();
587 EffectKey yKey = displacementMap.yChannelSelector() << SkDisplacementMapEffe ct::kKeyBits; 586 EffectKey yKey = displacementMap.yChannelSelector() << SkDisplacementMapEffe ct::kKeyBits;
588 587
589 return xKey | yKey; 588 return xKey | yKey;
590 } 589 }
591 #endif 590 #endif
OLDNEW
« no previous file with comments | « src/effects/SkBlurImageFilter.cpp ('k') | src/effects/SkLightingImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698