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

Side by Side Diff: src/gpu/SkGr.cpp

Issue 2396953002: Revert[8] "replace SkXfermode obj with SkBlendMode enum in paints" (Closed)
Patch Set: add tmp virtual to unroll legacy arithmodes Created 4 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/gpu/GrYUVProvider.cpp ('k') | src/gpu/effects/GrConfigConversionEffect.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 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"
11 11
12 #include "GrCaps.h" 12 #include "GrCaps.h"
13 #include "GrContext.h" 13 #include "GrContext.h"
14 #include "GrDrawContext.h" 14 #include "GrDrawContext.h"
15 #include "GrGpuResourcePriv.h" 15 #include "GrGpuResourcePriv.h"
16 #include "GrImageIDTextureAdjuster.h" 16 #include "GrImageIDTextureAdjuster.h"
17 #include "GrTextureParamsAdjuster.h" 17 #include "GrTextureParamsAdjuster.h"
18 #include "GrTexturePriv.h" 18 #include "GrTexturePriv.h"
19 #include "GrTypes.h" 19 #include "GrTypes.h"
20 #include "GrXferProcessor.h" 20 #include "GrXferProcessor.h"
21 #include "GrYUVProvider.h" 21 #include "GrYUVProvider.h"
22 22
23 #include "SkBlendModePriv.h"
23 #include "SkColorFilter.h" 24 #include "SkColorFilter.h"
24 #include "SkConfig8888.h" 25 #include "SkConfig8888.h"
25 #include "SkCanvas.h" 26 #include "SkCanvas.h"
26 #include "SkData.h" 27 #include "SkData.h"
27 #include "SkErrorInternals.h" 28 #include "SkErrorInternals.h"
28 #include "SkMessageBus.h" 29 #include "SkMessageBus.h"
29 #include "SkMipMap.h" 30 #include "SkMipMap.h"
30 #include "SkPixelRef.h" 31 #include "SkPixelRef.h"
31 #include "SkPM4fPriv.h" 32 #include "SkPM4fPriv.h"
32 #include "SkResourceCache.h" 33 #include "SkResourceCache.h"
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after
673 grPaint->addColorFragmentProcessor(std::move(cfFP)); 674 grPaint->addColorFragmentProcessor(std::move(cfFP));
674 } else { 675 } else {
675 return false; 676 return false;
676 } 677 }
677 } 678 }
678 } 679 }
679 680
680 // When the xfermode is null on the SkPaint (meaning kSrcOver) we need the X PFactory field on 681 // When the xfermode is null on the SkPaint (meaning kSrcOver) we need the X PFactory field on
681 // the GrPaint to also be null (also kSrcOver). 682 // the GrPaint to also be null (also kSrcOver).
682 SkASSERT(!grPaint->getXPFactory()); 683 SkASSERT(!grPaint->getXPFactory());
683 SkXfermode* xfermode = skPaint.getXfermode(); 684 if (!skPaint.isSrcOver()) {
684 if (xfermode) { 685 grPaint->setXPFactory(SkBlendMode_AsXPFactory(skPaint.getBlendMode()));
685 grPaint->setXPFactory(xfermode->asXPFactory());
686 } 686 }
687 687
688 #ifndef SK_IGNORE_GPU_DITHER 688 #ifndef SK_IGNORE_GPU_DITHER
689 if (skPaint.isDither() && grPaint->numColorFragmentProcessors() > 0 && !dc-> isGammaCorrect()) { 689 if (skPaint.isDither() && grPaint->numColorFragmentProcessors() > 0 && !dc-> isGammaCorrect()) {
690 grPaint->addColorFragmentProcessor(GrDitherEffect::Make()); 690 grPaint->addColorFragmentProcessor(GrDitherEffect::Make());
691 } 691 }
692 #endif 692 #endif
693 return true; 693 return true;
694 } 694 }
695 695
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
804 SkErrorInternals::SetError( kInvalidPaint_SkError, 804 SkErrorInternals::SetError( kInvalidPaint_SkError,
805 "Sorry, I don't understand the filtering " 805 "Sorry, I don't understand the filtering "
806 "mode you asked for. Falling back to " 806 "mode you asked for. Falling back to "
807 "MIPMaps."); 807 "MIPMaps.");
808 textureFilterMode = GrTextureParams::kMipMap_FilterMode; 808 textureFilterMode = GrTextureParams::kMipMap_FilterMode;
809 break; 809 break;
810 810
811 } 811 }
812 return textureFilterMode; 812 return textureFilterMode;
813 } 813 }
OLDNEW
« no previous file with comments | « src/gpu/GrYUVProvider.cpp ('k') | src/gpu/effects/GrConfigConversionEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698