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

Side by Side Diff: src/effects/SkXfermodeImageFilter.cpp

Issue 1845283003: Gamma-correctness pushed into Skia, top-down. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase Created 4 years, 8 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
OLDNEW
1 /* 1 /*
2 * Copyright 2013 The Android Open Source Project 2 * Copyright 2013 The Android Open Source Project
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 "SkXfermodeImageFilter.h" 8 #include "SkXfermodeImageFilter.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkDevice.h" 10 #include "SkDevice.h"
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 desc.fFlags = kRenderTarget_GrSurfaceFlag; 166 desc.fFlags = kRenderTarget_GrSurfaceFlag;
167 desc.fWidth = bounds.width(); 167 desc.fWidth = bounds.width();
168 desc.fHeight = bounds.height(); 168 desc.fHeight = bounds.height();
169 desc.fConfig = kSkia8888_GrPixelConfig; 169 desc.fConfig = kSkia8888_GrPixelConfig;
170 SkAutoTUnref<GrTexture> dst(context->textureProvider()->createApproxTexture( desc)); 170 SkAutoTUnref<GrTexture> dst(context->textureProvider()->createApproxTexture( desc));
171 if (!dst) { 171 if (!dst) {
172 return false; 172 return false;
173 } 173 }
174 174
175 GrPaint paint; 175 GrPaint paint;
176 // SRGBTODO: AllowSRGBInputs?
bsalomon 2016/04/06 13:19:28 This in the deprecated code path, probably doesn't
176 SkAutoTUnref<const GrFragmentProcessor> bgFP; 177 SkAutoTUnref<const GrFragmentProcessor> bgFP;
177 178
178 if (backgroundTex) { 179 if (backgroundTex) {
179 SkMatrix backgroundMatrix; 180 SkMatrix backgroundMatrix;
180 backgroundMatrix.setIDiv(backgroundTex->width(), backgroundTex->height() ); 181 backgroundMatrix.setIDiv(backgroundTex->width(), backgroundTex->height() );
181 backgroundMatrix.preTranslate(SkIntToScalar(-backgroundOffset.fX), 182 backgroundMatrix.preTranslate(SkIntToScalar(-backgroundOffset.fX),
182 SkIntToScalar(-backgroundOffset.fY)); 183 SkIntToScalar(-backgroundOffset.fY));
183 bgFP.reset(GrTextureDomainEffect::Create( 184 bgFP.reset(GrTextureDomainEffect::Create(
184 backgroundTex, backgroundMatrix, 185 backgroundTex, backgroundMatrix,
185 GrTextureDomain::MakeTexelDomain(backgroundTex, back ground.bounds()), 186 GrTextureDomain::MakeTexelDomain(backgroundTex, back ground.bounds()),
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 matrix.setTranslate(SkIntToScalar(-bounds.left()), SkIntToScalar(-bounds.top ())); 241 matrix.setTranslate(SkIntToScalar(-bounds.left()), SkIntToScalar(-bounds.top ()));
241 drawContext->drawRect(GrClip::WideOpen(), paint, matrix, SkRect::Make(bounds )); 242 drawContext->drawRect(GrClip::WideOpen(), paint, matrix, SkRect::Make(bounds ));
242 243
243 offset->fX = bounds.left(); 244 offset->fX = bounds.left();
244 offset->fY = bounds.top(); 245 offset->fY = bounds.top();
245 GrWrapTextureInBitmap(dst, bounds.width(), bounds.height(), false, result); 246 GrWrapTextureInBitmap(dst, bounds.width(), bounds.height(), false, result);
246 return true; 247 return true;
247 } 248 }
248 249
249 #endif 250 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698