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

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

Issue 27471002: Implement crop rect support for SkMatrixConvolutionImageFilter. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Fix style issue Created 7 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 | Annotate | Revision Log
« no previous file with comments | « src/effects/SkLightingImageFilter.cpp ('k') | src/effects/SkMatrixConvolutionImageFilter.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 2012 The Android Open Source Project 2 * Copyright 2012 The Android Open Source Project
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 "SkBitmap.h" 8 #include "SkBitmap.h"
9 #include "SkMagnifierImageFilter.h" 9 #include "SkMagnifierImageFilter.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 fInset = buffer.readScalar(); 240 fInset = buffer.readScalar();
241 } 241 }
242 242
243 // FIXME: implement single-input semantics 243 // FIXME: implement single-input semantics
244 SkMagnifierImageFilter::SkMagnifierImageFilter(SkRect srcRect, SkScalar inset) 244 SkMagnifierImageFilter::SkMagnifierImageFilter(SkRect srcRect, SkScalar inset)
245 : INHERITED(0), fSrcRect(srcRect), fInset(inset) { 245 : INHERITED(0), fSrcRect(srcRect), fInset(inset) {
246 SkASSERT(srcRect.x() >= 0 && srcRect.y() >= 0 && inset >= 0); 246 SkASSERT(srcRect.x() >= 0 && srcRect.y() >= 0 && inset >= 0);
247 } 247 }
248 248
249 #if SK_SUPPORT_GPU 249 #if SK_SUPPORT_GPU
250 bool SkMagnifierImageFilter::asNewEffect(GrEffectRef** effect, GrTexture* textur e, const SkMatrix&) const { 250 bool SkMagnifierImageFilter::asNewEffect(GrEffectRef** effect, GrTexture* textur e, const SkMatrix&, const SkIRect&) const {
251 if (effect) { 251 if (effect) {
252 *effect = GrMagnifierEffect::Create(texture, 252 *effect = GrMagnifierEffect::Create(texture,
253 fSrcRect.x() / texture->width(), 253 fSrcRect.x() / texture->width(),
254 fSrcRect.y() / texture->height(), 254 fSrcRect.y() / texture->height(),
255 texture->width() / fSrcRect.width(), 255 texture->width() / fSrcRect.width(),
256 texture->height() / fSrcRect.height( ), 256 texture->height() / fSrcRect.height( ),
257 fInset / texture->width(), 257 fInset / texture->width(),
258 fInset / texture->height()); 258 fInset / texture->height());
259 } 259 }
260 return true; 260 return true;
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 328
329 int x_val = SkMin32(SkScalarFloorToInt(x_interp), width - 1); 329 int x_val = SkMin32(SkScalarFloorToInt(x_interp), width - 1);
330 int y_val = SkMin32(SkScalarFloorToInt(y_interp), height - 1); 330 int y_val = SkMin32(SkScalarFloorToInt(y_interp), height - 1);
331 331
332 *dptr = sptr[y_val * width + x_val]; 332 *dptr = sptr[y_val * width + x_val];
333 dptr++; 333 dptr++;
334 } 334 }
335 } 335 }
336 return true; 336 return true;
337 } 337 }
OLDNEW
« no previous file with comments | « src/effects/SkLightingImageFilter.cpp ('k') | src/effects/SkMatrixConvolutionImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698