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

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

Issue 356513003: Step towards variable length effect keys. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tweak comment Created 6 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 unified diff | Download patch
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2014 Google Inc. 3 * Copyright 2014 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "SkTwoPointConicalGradient_gpu.h" 9 #include "SkTwoPointConicalGradient_gpu.h"
10 10
11 #include "SkTwoPointConicalGradient.h" 11 #include "SkTwoPointConicalGradient.h"
12 12
13 #if SK_SUPPORT_GPU 13 #if SK_SUPPORT_GPU
14 #include "GrTBackendEffectFactory.h" 14 #include "GrTBackendEffectFactory.h"
15 #include "gl/GrGLShaderBuilder.h"
15 // For brevity 16 // For brevity
16 typedef GrGLUniformManager::UniformHandle UniformHandle; 17 typedef GrGLUniformManager::UniformHandle UniformHandle;
17 18
18 static const SkScalar kErrorTol = 0.00001f; 19 static const SkScalar kErrorTol = 0.00001f;
19 static const SkScalar kEdgeErrorTol = 5.f * kErrorTol; 20 static const SkScalar kEdgeErrorTol = 5.f * kErrorTol;
20 21
21 /** 22 /**
22 * We have three general cases for 2pt conical gradients. First we always assume that 23 * We have three general cases for 2pt conical gradients. First we always assume that
23 * the start radius <= end radius. Our first case (kInside_) is when the start c ircle 24 * the start radius <= end radius. Our first case (kInside_) is when the start c ircle
24 * is completely enclosed by the end circle. The second case (kOutside_) is the case 25 * is completely enclosed by the end circle. The second case (kOutside_) is the case
(...skipping 1291 matching lines...) Expand 10 before | Expand all | Expand 10 after
1316 return CircleInside2PtConicalEffect::Create(ctx, shader, matrix, tm, inf o); 1317 return CircleInside2PtConicalEffect::Create(ctx, shader, matrix, tm, inf o);
1317 } else if (type == kEdge_ConicalType) { 1318 } else if (type == kEdge_ConicalType) {
1318 set_matrix_edge_conical(shader, &matrix); 1319 set_matrix_edge_conical(shader, &matrix);
1319 return Edge2PtConicalEffect::Create(ctx, shader, matrix, tm); 1320 return Edge2PtConicalEffect::Create(ctx, shader, matrix, tm);
1320 } else { 1321 } else {
1321 return CircleOutside2PtConicalEffect::Create(ctx, shader, matrix, tm, in fo); 1322 return CircleOutside2PtConicalEffect::Create(ctx, shader, matrix, tm, in fo);
1322 } 1323 }
1323 } 1324 }
1324 1325
1325 #endif 1326 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698