 Chromium Code Reviews
 Chromium Code Reviews Issue 2113793002:
  Never allow dither for non-legacy (sRGB or F16) targets.  (Closed) 
  Base URL: https://skia.googlesource.com/skia.git@master
    
  
    Issue 2113793002:
  Never allow dither for non-legacy (sRGB or F16) targets.  (Closed) 
  Base URL: https://skia.googlesource.com/skia.git@master| OLD | NEW | 
|---|---|
| 1 /* | 1 /* | 
| 2 * Copyright 2010 Google Inc. | 2 * Copyright 2010 Google Inc. | 
| 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 | 8 | 
| 9 #include "SkGr.h" | 9 #include "SkGr.h" | 
| 10 #include "SkGrPriv.h" | 10 #include "SkGrPriv.h" | 
| (...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 648 | 648 | 
| 649 // When the xfermode is null on the SkPaint (meaning kSrcOver) we need the X PFactory field on | 649 // When the xfermode is null on the SkPaint (meaning kSrcOver) we need the X PFactory field on | 
| 650 // the GrPaint to also be null (also kSrcOver). | 650 // the GrPaint to also be null (also kSrcOver). | 
| 651 SkASSERT(!grPaint->getXPFactory()); | 651 SkASSERT(!grPaint->getXPFactory()); | 
| 652 SkXfermode* xfermode = skPaint.getXfermode(); | 652 SkXfermode* xfermode = skPaint.getXfermode(); | 
| 653 if (xfermode) { | 653 if (xfermode) { | 
| 654 grPaint->setXPFactory(xfermode->asXPFactory()); | 654 grPaint->setXPFactory(xfermode->asXPFactory()); | 
| 655 } | 655 } | 
| 656 | 656 | 
| 657 #ifndef SK_IGNORE_GPU_DITHER | 657 #ifndef SK_IGNORE_GPU_DITHER | 
| 658 if (skPaint.isDither() && grPaint->numColorFragmentProcessors() > 0) { | 658 if (skPaint.isDither() && grPaint->numColorFragmentProcessors() > 0 && !allo wSRGBInputs) { | 
| 
jvanverth1
2016/06/30 20:21:37
Does allowSRGBInputs include F16? If so, that seem
 | |
| 659 grPaint->addColorFragmentProcessor(GrDitherEffect::Make()); | 659 grPaint->addColorFragmentProcessor(GrDitherEffect::Make()); | 
| 660 } | 660 } | 
| 661 #endif | 661 #endif | 
| 662 return true; | 662 return true; | 
| 663 } | 663 } | 
| 664 | 664 | 
| 665 bool SkPaintToGrPaint(GrContext* context, const SkPaint& skPaint, const SkMatrix & viewM, | 665 bool SkPaintToGrPaint(GrContext* context, const SkPaint& skPaint, const SkMatrix & viewM, | 
| 666 bool allowSRGBInputs, GrPaint* grPaint) { | 666 bool allowSRGBInputs, GrPaint* grPaint) { | 
| 667 return skpaint_to_grpaint_impl(context, skPaint, viewM, nullptr, nullptr, fa lse, | 667 return skpaint_to_grpaint_impl(context, skPaint, viewM, nullptr, nullptr, fa lse, | 
| 668 allowSRGBInputs, grPaint); | 668 allowSRGBInputs, grPaint); | 
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 798 SkErrorInternals::SetError( kInvalidPaint_SkError, | 798 SkErrorInternals::SetError( kInvalidPaint_SkError, | 
| 799 "Sorry, I don't understand the filtering " | 799 "Sorry, I don't understand the filtering " | 
| 800 "mode you asked for. Falling back to " | 800 "mode you asked for. Falling back to " | 
| 801 "MIPMaps."); | 801 "MIPMaps."); | 
| 802 textureFilterMode = GrTextureParams::kMipMap_FilterMode; | 802 textureFilterMode = GrTextureParams::kMipMap_FilterMode; | 
| 803 break; | 803 break; | 
| 804 | 804 | 
| 805 } | 805 } | 
| 806 return textureFilterMode; | 806 return textureFilterMode; | 
| 807 } | 807 } | 
| OLD | NEW |