OLD | NEW |
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 "GrOvalEffect.h" | 8 #include "GrOvalEffect.h" |
9 | 9 |
10 #include "GrFragmentProcessor.h" | 10 #include "GrFragmentProcessor.h" |
11 #include "GrInvariantOutput.h" | 11 #include "GrInvariantOutput.h" |
12 #include "SkRect.h" | 12 #include "SkRect.h" |
13 #include "gl/GrGLProcessor.h" | 13 #include "gl/GrGLFragmentProcessor.h" |
14 #include "gl/builders/GrGLProgramBuilder.h" | 14 #include "gl/builders/GrGLProgramBuilder.h" |
15 | 15 |
16 ////////////////////////////////////////////////////////////////////////////// | 16 ////////////////////////////////////////////////////////////////////////////// |
17 | 17 |
18 class CircleEffect : public GrFragmentProcessor { | 18 class CircleEffect : public GrFragmentProcessor { |
19 public: | 19 public: |
20 static GrFragmentProcessor* Create(GrPrimitiveEdgeType, const SkPoint& cente
r, SkScalar radius); | 20 static GrFragmentProcessor* Create(GrPrimitiveEdgeType, const SkPoint& cente
r, SkScalar radius); |
21 | 21 |
22 virtual ~CircleEffect() {}; | 22 virtual ~CircleEffect() {}; |
23 | 23 |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 w /= 2; | 385 w /= 2; |
386 return CircleEffect::Create(edgeType, SkPoint::Make(oval.fLeft + w, oval
.fTop + w), w); | 386 return CircleEffect::Create(edgeType, SkPoint::Make(oval.fLeft + w, oval
.fTop + w), w); |
387 } else { | 387 } else { |
388 w /= 2; | 388 w /= 2; |
389 h /= 2; | 389 h /= 2; |
390 return EllipseEffect::Create(edgeType, SkPoint::Make(oval.fLeft + w, ova
l.fTop + h), w, h); | 390 return EllipseEffect::Create(edgeType, SkPoint::Make(oval.fLeft + w, ova
l.fTop + h), w, h); |
391 } | 391 } |
392 | 392 |
393 return NULL; | 393 return NULL; |
394 } | 394 } |
OLD | NEW |