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

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

Issue 1845283003: Gamma-correctness pushed into Skia, top-down. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase Created 4 years, 8 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
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 "SkLightingImageFilter.h" 8 #include "SkLightingImageFilter.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 void SkLightingImageFilterInternal::drawRect(GrDrawContext* drawContext, 380 void SkLightingImageFilterInternal::drawRect(GrDrawContext* drawContext,
381 GrTexture* src, 381 GrTexture* src,
382 const SkMatrix& matrix, 382 const SkMatrix& matrix,
383 const GrClip& clip, 383 const GrClip& clip,
384 const SkRect& dstRect, 384 const SkRect& dstRect,
385 BoundaryMode boundaryMode, 385 BoundaryMode boundaryMode,
386 const SkIRect* srcBounds, 386 const SkIRect* srcBounds,
387 const SkIRect& bounds) const { 387 const SkIRect& bounds) const {
388 SkRect srcRect = dstRect.makeOffset(SkIntToScalar(bounds.x()), SkIntToScalar (bounds.y())); 388 SkRect srcRect = dstRect.makeOffset(SkIntToScalar(bounds.x()), SkIntToScalar (bounds.y()));
389 GrPaint paint; 389 GrPaint paint;
390 // SRGBTODO: AllowSRGBInputs?
bsalomon 2016/04/06 13:19:28 Also senorblanco@
390 GrFragmentProcessor* fp = this->getFragmentProcessor(src, matrix, srcBounds, boundaryMode); 391 GrFragmentProcessor* fp = this->getFragmentProcessor(src, matrix, srcBounds, boundaryMode);
391 paint.addColorFragmentProcessor(fp)->unref(); 392 paint.addColorFragmentProcessor(fp)->unref();
392 paint.setPorterDuffXPFactory(SkXfermode::kSrc_Mode); 393 paint.setPorterDuffXPFactory(SkXfermode::kSrc_Mode);
393 drawContext->fillRectToRect(clip, paint, SkMatrix::I(), dstRect, srcRect); 394 drawContext->fillRectToRect(clip, paint, SkMatrix::I(), dstRect, srcRect);
394 } 395 }
395 396
396 bool SkLightingImageFilterInternal::filterImageGPUDeprecated(Proxy* proxy, 397 bool SkLightingImageFilterInternal::filterImageGPUDeprecated(Proxy* proxy,
397 const SkBitmap& src , 398 const SkBitmap& src ,
398 const Context& ctx, 399 const Context& ctx,
399 SkBitmap* result, 400 SkBitmap* result,
(...skipping 1720 matching lines...) Expand 10 before | Expand all | Expand 10 after
2120 2121
2121 fragBuilder->codeAppendf("%s(%s)", fLightColorFunc.c_str(), surfaceToLight); 2122 fragBuilder->codeAppendf("%s(%s)", fLightColorFunc.c_str(), surfaceToLight);
2122 } 2123 }
2123 2124
2124 #endif 2125 #endif
2125 2126
2126 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingImageFilter) 2127 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingImageFilter)
2127 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiffuseLightingImageFilter) 2128 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiffuseLightingImageFilter)
2128 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSpecularLightingImageFilter) 2129 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSpecularLightingImageFilter)
2129 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END 2130 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698