| 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/GrGLProcessor.h" |
| 14 #include "gl/GrGLSL.h" | |
| 15 #include "gl/builders/GrGLProgramBuilder.h" | 14 #include "gl/builders/GrGLProgramBuilder.h" |
| 16 | 15 |
| 17 ////////////////////////////////////////////////////////////////////////////// | 16 ////////////////////////////////////////////////////////////////////////////// |
| 18 | 17 |
| 19 class CircleEffect : public GrFragmentProcessor { | 18 class CircleEffect : public GrFragmentProcessor { |
| 20 public: | 19 public: |
| 21 static GrFragmentProcessor* Create(GrPrimitiveEdgeType, const SkPoint& cente
r, SkScalar radius); | 20 static GrFragmentProcessor* Create(GrPrimitiveEdgeType, const SkPoint& cente
r, SkScalar radius); |
| 22 | 21 |
| 23 virtual ~CircleEffect() {}; | 22 virtual ~CircleEffect() {}; |
| 24 | 23 |
| (...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 w /= 2; | 391 w /= 2; |
| 393 return CircleEffect::Create(edgeType, SkPoint::Make(oval.fLeft + w, oval
.fTop + w), w); | 392 return CircleEffect::Create(edgeType, SkPoint::Make(oval.fLeft + w, oval
.fTop + w), w); |
| 394 } else { | 393 } else { |
| 395 w /= 2; | 394 w /= 2; |
| 396 h /= 2; | 395 h /= 2; |
| 397 return EllipseEffect::Create(edgeType, SkPoint::Make(oval.fLeft + w, ova
l.fTop + h), w, h); | 396 return EllipseEffect::Create(edgeType, SkPoint::Make(oval.fLeft + w, ova
l.fTop + h), w, h); |
| 398 } | 397 } |
| 399 | 398 |
| 400 return NULL; | 399 return NULL; |
| 401 } | 400 } |
| OLD | NEW |