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

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

Issue 2358433004: Cleanup some sRGB TODOs, mostly around setting GrPaint flags correctly (Closed)
Patch Set: Created 4 years, 3 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/SkLightingImageFilter.cpp ('k') | src/effects/SkXfermodeImageFilter.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 "SkMorphologyImageFilter.h" 8 #include "SkMorphologyImageFilter.h"
9 9
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 static void apply_morphology_rect(GrDrawContext* drawContext, 387 static void apply_morphology_rect(GrDrawContext* drawContext,
388 const GrClip& clip, 388 const GrClip& clip,
389 GrTexture* texture, 389 GrTexture* texture,
390 const SkIRect& srcRect, 390 const SkIRect& srcRect,
391 const SkIRect& dstRect, 391 const SkIRect& dstRect,
392 int radius, 392 int radius,
393 GrMorphologyEffect::MorphologyType morphType, 393 GrMorphologyEffect::MorphologyType morphType,
394 float bounds[2], 394 float bounds[2],
395 Gr1DKernelEffect::Direction direction) { 395 Gr1DKernelEffect::Direction direction) {
396 GrPaint paint; 396 GrPaint paint;
397 // SRGBTODO: AllowSRGBInputs? 397 paint.setAllowSRGBInputs(drawContext->isGammaCorrect());
398 paint.addColorFragmentProcessor(GrMorphologyEffect::Make(texture, 398 paint.addColorFragmentProcessor(GrMorphologyEffect::Make(texture,
399 direction, 399 direction,
400 radius, 400 radius,
401 morphType, 401 morphType,
402 bounds)); 402 bounds));
403 paint.setPorterDuffXPFactory(SkXfermode::kSrc_Mode); 403 paint.setPorterDuffXPFactory(SkXfermode::kSrc_Mode);
404 drawContext->fillRectToRect(clip, paint, SkMatrix::I(), SkRect::Make(dstRect ), 404 drawContext->fillRectToRect(clip, paint, SkMatrix::I(), SkRect::Make(dstRect ),
405 SkRect::Make(srcRect)); 405 SkRect::Make(srcRect));
406 } 406 }
407 407
408 static void apply_morphology_rect_no_bounds(GrDrawContext* drawContext, 408 static void apply_morphology_rect_no_bounds(GrDrawContext* drawContext,
409 const GrClip& clip, 409 const GrClip& clip,
410 GrTexture* texture, 410 GrTexture* texture,
411 const SkIRect& srcRect, 411 const SkIRect& srcRect,
412 const SkIRect& dstRect, 412 const SkIRect& dstRect,
413 int radius, 413 int radius,
414 GrMorphologyEffect::MorphologyType m orphType, 414 GrMorphologyEffect::MorphologyType m orphType,
415 Gr1DKernelEffect::Direction directio n) { 415 Gr1DKernelEffect::Direction directio n) {
416 GrPaint paint; 416 GrPaint paint;
417 // SRGBTODO: AllowSRGBInputs? 417 paint.setAllowSRGBInputs(drawContext->isGammaCorrect());
418 paint.addColorFragmentProcessor(GrMorphologyEffect::Make(texture, direction, radius, 418 paint.addColorFragmentProcessor(GrMorphologyEffect::Make(texture, direction, radius,
419 morphType)); 419 morphType));
420 paint.setPorterDuffXPFactory(SkXfermode::kSrc_Mode); 420 paint.setPorterDuffXPFactory(SkXfermode::kSrc_Mode);
421 drawContext->fillRectToRect(clip, paint, SkMatrix::I(), SkRect::Make(dstRect ), 421 drawContext->fillRectToRect(clip, paint, SkMatrix::I(), SkRect::Make(dstRect ),
422 SkRect::Make(srcRect)); 422 SkRect::Make(srcRect));
423 } 423 }
424 424
425 static void apply_morphology_pass(GrDrawContext* drawContext, 425 static void apply_morphology_pass(GrDrawContext* drawContext,
426 const GrClip& clip, 426 const GrClip& clip,
427 GrTexture* texture, 427 GrTexture* texture,
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
630 inputBM.getAddr32(srcBounds.left(), srcBounds.top()), 630 inputBM.getAddr32(srcBounds.left(), srcBounds.top()),
631 inputBM.rowBytesAsPixels(), 631 inputBM.rowBytesAsPixels(),
632 &dst, height, srcBounds); 632 &dst, height, srcBounds);
633 } 633 }
634 offset->fX = bounds.left(); 634 offset->fX = bounds.left();
635 offset->fY = bounds.top(); 635 offset->fY = bounds.top();
636 636
637 return SkSpecialImage::MakeFromRaster(SkIRect::MakeWH(bounds.width(), bounds .height()), 637 return SkSpecialImage::MakeFromRaster(SkIRect::MakeWH(bounds.width(), bounds .height()),
638 dst, &source->props()); 638 dst, &source->props());
639 } 639 }
OLDNEW
« no previous file with comments | « src/effects/SkLightingImageFilter.cpp ('k') | src/effects/SkXfermodeImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698