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

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

Issue 1225923010: Refugee from Dead Machine 4: MDB Monster Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Last update from dead machine Created 4 years, 7 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/SkMagnifierImageFilter.cpp ('k') | src/effects/SkMorphologyImageFilter.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 "SkMatrixConvolutionImageFilter.h" 8 #include "SkMatrixConvolutionImageFilter.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 return GrTextureDomain::kDecal_Mode; 348 return GrTextureDomain::kDecal_Mode;
349 default: 349 default:
350 SkASSERT(false); 350 SkASSERT(false);
351 } 351 }
352 return GrTextureDomain::kIgnore_Mode; 352 return GrTextureDomain::kIgnore_Mode;
353 } 353 }
354 354
355 bool SkMatrixConvolutionImageFilter::asFragmentProcessor(GrFragmentProcessor** f p, 355 bool SkMatrixConvolutionImageFilter::asFragmentProcessor(GrFragmentProcessor** f p,
356 GrTexture* texture, 356 GrTexture* texture,
357 const SkMatrix&, 357 const SkMatrix&,
358 const SkIRect& bounds) const { 358 const SkIRect& bounds, GrRenderTarget* dst) const {
359 if (!fp) { 359 if (!fp) {
360 return fKernelSize.width() * fKernelSize.height() <= MAX_KERNEL_SIZE; 360 return fKernelSize.width() * fKernelSize.height() <= MAX_KERNEL_SIZE;
361 } 361 }
362 SkASSERT(fKernelSize.width() * fKernelSize.height() <= MAX_KERNEL_SIZE); 362 SkASSERT(fKernelSize.width() * fKernelSize.height() <= MAX_KERNEL_SIZE);
363 *fp = GrMatrixConvolutionEffect::Create(texture, 363 *fp = GrMatrixConvolutionEffect::Create(texture,
364 bounds, 364 bounds,
365 fKernelSize, 365 fKernelSize,
366 fKernel, 366 fKernel,
367 fGain, 367 fGain,
368 fBias, 368 fBias,
369 fKernelOffset, 369 fKernelOffset,
370 convert_tilemodes(fTileMode), 370 convert_tilemodes(fTileMode),
371 fConvolveAlpha); 371 fConvolveAlpha, dst);
372 return true; 372 return true;
373 } 373 }
374 #endif 374 #endif
375 375
376 #ifndef SK_IGNORE_TO_STRING 376 #ifndef SK_IGNORE_TO_STRING
377 void SkMatrixConvolutionImageFilter::toString(SkString* str) const { 377 void SkMatrixConvolutionImageFilter::toString(SkString* str) const {
378 str->appendf("SkMatrixConvolutionImageFilter: ("); 378 str->appendf("SkMatrixConvolutionImageFilter: (");
379 str->appendf("size: (%d,%d) kernel: (", fKernelSize.width(), fKernelSize.hei ght()); 379 str->appendf("size: (%d,%d) kernel: (", fKernelSize.width(), fKernelSize.hei ght());
380 for (int y = 0; y < fKernelSize.height(); y++) { 380 for (int y = 0; y < fKernelSize.height(); y++) {
381 for (int x = 0; x < fKernelSize.width(); x++) { 381 for (int x = 0; x < fKernelSize.width(); x++) {
382 str->appendf("%f ", fKernel[y * fKernelSize.width() + x]); 382 str->appendf("%f ", fKernel[y * fKernelSize.width() + x]);
383 } 383 }
384 } 384 }
385 str->appendf(")"); 385 str->appendf(")");
386 str->appendf("gain: %f bias: %f ", fGain, fBias); 386 str->appendf("gain: %f bias: %f ", fGain, fBias);
387 str->appendf("offset: (%d, %d) ", fKernelOffset.fX, fKernelOffset.fY); 387 str->appendf("offset: (%d, %d) ", fKernelOffset.fX, fKernelOffset.fY);
388 str->appendf("convolveAlpha: %s", fConvolveAlpha ? "true" : "false"); 388 str->appendf("convolveAlpha: %s", fConvolveAlpha ? "true" : "false");
389 str->append(")"); 389 str->append(")");
390 } 390 }
391 #endif 391 #endif
OLDNEW
« no previous file with comments | « src/effects/SkMagnifierImageFilter.cpp ('k') | src/effects/SkMorphologyImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698