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

Side by Side Diff: src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp

Issue 2337313002: (Some) gradients are gamma and gamut correct on GPU (Closed)
Patch Set: Rebase Created 4 years, 3 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 2014 Google Inc. 2 * Copyright 2014 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 "SkTwoPointConicalGradient_gpu.h" 8 #include "SkTwoPointConicalGradient_gpu.h"
9 9
10 #include "SkTwoPointConicalGradient.h" 10 #include "SkTwoPointConicalGradient.h"
(...skipping 1287 matching lines...) Expand 10 before | Expand all | Expand 10 after
1298 return nullptr; 1298 return nullptr;
1299 } 1299 }
1300 if (args.fMatrix) { 1300 if (args.fMatrix) {
1301 SkMatrix inv; 1301 SkMatrix inv;
1302 if (!args.fMatrix->invert(&inv)) { 1302 if (!args.fMatrix->invert(&inv)) {
1303 return nullptr; 1303 return nullptr;
1304 } 1304 }
1305 matrix.postConcat(inv); 1305 matrix.postConcat(inv);
1306 } 1306 }
1307 1307
1308 GrGradientEffect::CreateArgs newArgs(args.fContext, args.fShader, &matrix, a rgs.fTileMode); 1308 GrGradientEffect::CreateArgs newArgs(args.fContext, args.fShader, &matrix, a rgs.fTileMode,
1309 std::move(args.fColorSpaceXform), args. fGammaCorrect);
1309 1310
1310 if (shader.getStartRadius() < kErrorTol) { 1311 if (shader.getStartRadius() < kErrorTol) {
1311 SkScalar focalX; 1312 SkScalar focalX;
1312 ConicalType type = set_matrix_focal_conical(shader, &matrix, &focalX); 1313 ConicalType type = set_matrix_focal_conical(shader, &matrix, &focalX);
1313 if (type == kInside_ConicalType) { 1314 if (type == kInside_ConicalType) {
1314 return FocalInside2PtConicalEffect::Make(newArgs, focalX); 1315 return FocalInside2PtConicalEffect::Make(newArgs, focalX);
1315 } else if(type == kEdge_ConicalType) { 1316 } else if(type == kEdge_ConicalType) {
1316 set_matrix_edge_conical(shader, &matrix); 1317 set_matrix_edge_conical(shader, &matrix);
1317 return Edge2PtConicalEffect::Make(newArgs); 1318 return Edge2PtConicalEffect::Make(newArgs);
1318 } else { 1319 } else {
1319 return FocalOutside2PtConicalEffect::Make(newArgs, focalX); 1320 return FocalOutside2PtConicalEffect::Make(newArgs, focalX);
1320 } 1321 }
1321 } 1322 }
1322 1323
1323 CircleConicalInfo info; 1324 CircleConicalInfo info;
1324 ConicalType type = set_matrix_circle_conical(shader, &matrix, &info); 1325 ConicalType type = set_matrix_circle_conical(shader, &matrix, &info);
1325 1326
1326 if (type == kInside_ConicalType) { 1327 if (type == kInside_ConicalType) {
1327 return CircleInside2PtConicalEffect::Make(newArgs, info); 1328 return CircleInside2PtConicalEffect::Make(newArgs, info);
1328 } else if (type == kEdge_ConicalType) { 1329 } else if (type == kEdge_ConicalType) {
1329 set_matrix_edge_conical(shader, &matrix); 1330 set_matrix_edge_conical(shader, &matrix);
1330 return Edge2PtConicalEffect::Make(newArgs); 1331 return Edge2PtConicalEffect::Make(newArgs);
1331 } else { 1332 } else {
1332 return CircleOutside2PtConicalEffect::Make(newArgs, info); 1333 return CircleOutside2PtConicalEffect::Make(newArgs, info);
1333 } 1334 }
1334 } 1335 }
1335 1336
1336 #endif 1337 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698