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

Unified Diff: src/image/SkSurface_Gpu.cpp

Issue 2176383002: start on apply gamma cleanup (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: 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 | « src/image/SkSurface_Gpu.h ('k') | tools/viewer/sk_app/WindowContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/image/SkSurface_Gpu.cpp
diff --git a/src/image/SkSurface_Gpu.cpp b/src/image/SkSurface_Gpu.cpp
index ef8dd5f06e7196e2f41e5268461cb3959f07bf20..5d3f257d461b617ca40cbd20fa5327411a6ede2e 100644
--- a/src/image/SkSurface_Gpu.cpp
+++ b/src/image/SkSurface_Gpu.cpp
@@ -129,6 +129,17 @@ void SkSurface_Gpu::onPrepareForExternalIO() {
fDevice->flush();
}
+bool SkSurface_Gpu::onBlitWithGamma(SkImage* image, SkScalar gamma) {
+ GrRenderTarget* dst = fDevice->accessDrawContext()->accessRenderTarget();
+ if (GrTexture* src = as_IB(image)->asTextureRef(dst->getContext(),
+ GrTextureParams::ClampNoFilter(),
+ SkSourceGammaTreatment::kRespect)) {
+ fDevice.get()->context()->applyGamma(dst, src, gamma);
+ return true;
+ }
+ return false;
+}
+
///////////////////////////////////////////////////////////////////////////////
sk_sp<SkSurface> SkSurface::MakeRenderTargetDirect(GrRenderTarget* target,
« no previous file with comments | « src/image/SkSurface_Gpu.h ('k') | tools/viewer/sk_app/WindowContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698