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

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

Issue 1388113002: Bye bye processor data manager (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove files 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/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 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 return GrTextureDomain::kRepeat_Mode; 340 return GrTextureDomain::kRepeat_Mode;
341 case SkMatrixConvolutionImageFilter::kClampToBlack_TileMode: 341 case SkMatrixConvolutionImageFilter::kClampToBlack_TileMode:
342 return GrTextureDomain::kDecal_Mode; 342 return GrTextureDomain::kDecal_Mode;
343 default: 343 default:
344 SkASSERT(false); 344 SkASSERT(false);
345 } 345 }
346 return GrTextureDomain::kIgnore_Mode; 346 return GrTextureDomain::kIgnore_Mode;
347 } 347 }
348 348
349 bool SkMatrixConvolutionImageFilter::asFragmentProcessor(GrFragmentProcessor** f p, 349 bool SkMatrixConvolutionImageFilter::asFragmentProcessor(GrFragmentProcessor** f p,
350 GrProcessorDataManager* procDataManager,
351 GrTexture* texture, 350 GrTexture* texture,
352 const SkMatrix&, 351 const SkMatrix&,
353 const SkIRect& bounds) const { 352 const SkIRect& bounds) const {
354 if (!fp) { 353 if (!fp) {
355 return fKernelSize.width() * fKernelSize.height() <= MAX_KERNEL_SIZE; 354 return fKernelSize.width() * fKernelSize.height() <= MAX_KERNEL_SIZE;
356 } 355 }
357 SkASSERT(fKernelSize.width() * fKernelSize.height() <= MAX_KERNEL_SIZE); 356 SkASSERT(fKernelSize.width() * fKernelSize.height() <= MAX_KERNEL_SIZE);
358 *fp = GrMatrixConvolutionEffect::Create(procDataManager, 357 *fp = GrMatrixConvolutionEffect::Create(texture,
359 texture,
360 bounds, 358 bounds,
361 fKernelSize, 359 fKernelSize,
362 fKernel, 360 fKernel,
363 fGain, 361 fGain,
364 fBias, 362 fBias,
365 fKernelOffset, 363 fKernelOffset,
366 convert_tilemodes(fTileMode), 364 convert_tilemodes(fTileMode),
367 fConvolveAlpha); 365 fConvolveAlpha);
368 return true; 366 return true;
369 } 367 }
370 #endif 368 #endif
371 369
372 #ifndef SK_IGNORE_TO_STRING 370 #ifndef SK_IGNORE_TO_STRING
373 void SkMatrixConvolutionImageFilter::toString(SkString* str) const { 371 void SkMatrixConvolutionImageFilter::toString(SkString* str) const {
374 str->appendf("SkMatrixConvolutionImageFilter: ("); 372 str->appendf("SkMatrixConvolutionImageFilter: (");
375 str->appendf("size: (%d,%d) kernel: (", fKernelSize.width(), fKernelSize.hei ght()); 373 str->appendf("size: (%d,%d) kernel: (", fKernelSize.width(), fKernelSize.hei ght());
376 for (int y = 0; y < fKernelSize.height(); y++) { 374 for (int y = 0; y < fKernelSize.height(); y++) {
377 for (int x = 0; x < fKernelSize.width(); x++) { 375 for (int x = 0; x < fKernelSize.width(); x++) {
378 str->appendf("%f ", fKernel[y * fKernelSize.width() + x]); 376 str->appendf("%f ", fKernel[y * fKernelSize.width() + x]);
379 } 377 }
380 } 378 }
381 str->appendf(")"); 379 str->appendf(")");
382 str->appendf("gain: %f bias: %f ", fGain, fBias); 380 str->appendf("gain: %f bias: %f ", fGain, fBias);
383 str->appendf("offset: (%d, %d) ", fKernelOffset.fX, fKernelOffset.fY); 381 str->appendf("offset: (%d, %d) ", fKernelOffset.fX, fKernelOffset.fY);
384 str->appendf("convolveAlpha: %s", fConvolveAlpha ? "true" : "false"); 382 str->appendf("convolveAlpha: %s", fConvolveAlpha ? "true" : "false");
385 str->append(")"); 383 str->append(")");
386 } 384 }
387 #endif 385 #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