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

Side by Side Diff: src/gpu/GrYUVProvider.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/GrTextureToYUVPlanes.cpp ('k') | src/gpu/SkGr.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 2015 Google Inc. 2 * Copyright 2015 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 #include "GrContext.h" 8 #include "GrContext.h"
9 #include "GrDrawContext.h" 9 #include "GrDrawContext.h"
10 #include "GrYUVProvider.h" 10 #include "GrYUVProvider.h"
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 // Otherwise, we do our shader math to go from YUV -> sRGB, manually convert sRGB -> Linear, 135 // Otherwise, we do our shader math to go from YUV -> sRGB, manually convert sRGB -> Linear,
136 // then let the HW convert Linear -> sRGB. 136 // then let the HW convert Linear -> sRGB.
137 if (GrPixelConfigIsSRGB(desc.fConfig)) { 137 if (GrPixelConfigIsSRGB(desc.fConfig)) {
138 if (ctx->caps()->srgbWriteControl()) { 138 if (ctx->caps()->srgbWriteControl()) {
139 paint.setDisableOutputConversionToSRGB(true); 139 paint.setDisableOutputConversionToSRGB(true);
140 } else { 140 } else {
141 paint.addColorFragmentProcessor(GrGammaEffect::Make(2.2f)); 141 paint.addColorFragmentProcessor(GrGammaEffect::Make(2.2f));
142 } 142 }
143 } 143 }
144 144
145 paint.setPorterDuffXPFactory(SkXfermode::kSrc_Mode); 145 paint.setPorterDuffXPFactory(SkBlendMode::kSrc);
146 const SkRect r = SkRect::MakeIWH(yuvInfo.fSizeInfo.fSizes[SkYUVSizeInfo::kY] .fWidth, 146 const SkRect r = SkRect::MakeIWH(yuvInfo.fSizeInfo.fSizes[SkYUVSizeInfo::kY] .fWidth,
147 yuvInfo.fSizeInfo.fSizes[SkYUVSizeInfo::kY].fHeight); 147 yuvInfo.fSizeInfo.fSizes[SkYUVSizeInfo::kY].fHeight);
148 148
149 drawContext->drawRect(GrNoClip(), paint, SkMatrix::I(), r); 149 drawContext->drawRect(GrNoClip(), paint, SkMatrix::I(), r);
150 150
151 return drawContext->asTexture(); 151 return drawContext->asTexture();
152 } 152 }
OLDNEW
« no previous file with comments | « src/gpu/GrTextureToYUVPlanes.cpp ('k') | src/gpu/SkGr.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698