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

Side by Side Diff: src/gpu/effects/GrRRectEffect.cpp

Issue 172233004: Add f suffix to 0.5 to fix mac 10.6 warning (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "GrRRectEffect.h" 8 #include "GrRRectEffect.h"
9 9
10 #include "gl/GrGLEffect.h" 10 #include "gl/GrGLEffect.h"
11 #include "gl/GrGLSL.h" 11 #include "gl/GrGLSL.h"
12 #include "GrTBackendEffectFactory.h" 12 #include "GrTBackendEffectFactory.h"
13 13
14 #include "SkPath.h" 14 #include "SkPath.h"
15 15
16 // This effect only supports circular corner rrects where all corners have the s ame radius 16 // This effect only supports circular corner rrects where all corners have the s ame radius
17 // which must be <= kRadiusMin. 17 // which must be <= kRadiusMin.
18 static const SkScalar kRadiusMin = 0.5; 18 static const SkScalar kRadiusMin = 0.5f;
19 19
20 ////////////////////////////////////////////////////////////////////////////// 20 //////////////////////////////////////////////////////////////////////////////
21 class GrGLRRectEffect : public GrGLEffect { 21 class GrGLRRectEffect : public GrGLEffect {
22 public: 22 public:
23 GrGLRRectEffect(const GrBackendEffectFactory&, const GrDrawEffect&); 23 GrGLRRectEffect(const GrBackendEffectFactory&, const GrDrawEffect&);
24 24
25 virtual void emitCode(GrGLShaderBuilder* builder, 25 virtual void emitCode(GrGLShaderBuilder* builder,
26 const GrDrawEffect& drawEffect, 26 const GrDrawEffect& drawEffect,
27 EffectKey key, 27 EffectKey key,
28 const char* outputColor, 28 const char* outputColor,
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 const GrDrawTargetCaps& caps, 146 const GrDrawTargetCaps& caps,
147 GrTexture*[]) { 147 GrTexture*[]) {
148 SkScalar w = random->nextRangeScalar(20.f, 1000.f); 148 SkScalar w = random->nextRangeScalar(20.f, 1000.f);
149 SkScalar h = random->nextRangeScalar(20.f, 1000.f); 149 SkScalar h = random->nextRangeScalar(20.f, 1000.f);
150 SkScalar r = random->nextRangeF(kRadiusMin, 9.f); 150 SkScalar r = random->nextRangeF(kRadiusMin, 9.f);
151 SkRRect rrect; 151 SkRRect rrect;
152 rrect.setRectXY(SkRect::MakeWH(w, h), r, r); 152 rrect.setRectXY(SkRect::MakeWH(w, h), r, r);
153 153
154 return GrRRectEffect::Create(rrect); 154 return GrRRectEffect::Create(rrect);
155 } 155 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698