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

Unified Diff: src/gpu/GrContext.cpp

Issue 2191323002: Remove GrContext::applyGamma (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix flushing in publishCanvas Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « samplecode/SampleApp.cpp ('k') | tests/ApplyGammaTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrContext.cpp
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index cbee2874ed0aa3fca0da8565bfda28ba8d5393ac..078cfbdb2ccf1eff54ecdec7065264c9e2f32bcf 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -527,40 +527,6 @@ bool GrContext::readSurfacePixels(GrSurface* src,
return true;
}
-bool GrContext::applyGamma(GrRenderTarget* dst, GrTexture* src, SkScalar gamma){
- ASSERT_SINGLE_OWNER
- RETURN_FALSE_IF_ABANDONED
- ASSERT_OWNED_RESOURCE(dst);
- ASSERT_OWNED_RESOURCE(src);
- GR_AUDIT_TRAIL_AUTO_FRAME(&fAuditTrail, "GrContext::applyGamma");
-
- // Dimensions must match exactly.
- if (dst->width() != src->width() || dst->height() != src->height()) {
- return false;
- }
-
- // TODO: Supply color space?
- sk_sp<GrDrawContext> drawContext(this->makeDrawContext(sk_ref_sp(dst), nullptr));
- if (!drawContext) {
- return false;
- }
-
- GrPaint paint;
- paint.addColorTextureProcessor(src, nullptr, GrCoordTransform::MakeDivByTextureWHMatrix(src));
- if (!SkScalarNearlyEqual(gamma, 1.0f)) {
- paint.addColorFragmentProcessor(GrGammaEffect::Make(gamma));
- }
- paint.setPorterDuffXPFactory(SkXfermode::kSrc_Mode);
- paint.setGammaCorrect(true);
-
- SkRect rect;
- src->getBoundsRect(&rect);
- drawContext->drawRect(GrNoClip(), paint, SkMatrix::I(), rect);
-
- this->flushSurfaceWrites(dst);
- return true;
-}
-
void GrContext::prepareSurfaceForExternalIO(GrSurface* surface) {
ASSERT_SINGLE_OWNER
RETURN_IF_ABANDONED
« no previous file with comments | « samplecode/SampleApp.cpp ('k') | tests/ApplyGammaTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698