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

Side by Side Diff: gm/rrectclipdrawpaint.cpp

Issue 2300623005: Replace a lot of 'static const' with 'constexpr' or 'const'. (Closed)
Patch Set: small msvc concession 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
« no previous file with comments | « gm/rrect.cpp ('k') | gm/rrects.cpp » ('j') | 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 2016 Google Inc. 2 * Copyright 2016 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 "gm.h" 8 #include "gm.h"
9 #include "SkPath.h" 9 #include "SkPath.h"
10 #include "SkGradientShader.h" 10 #include "SkGradientShader.h"
(...skipping 14 matching lines...) Expand all
25 canvas->drawPaint(p); 25 canvas->drawPaint(p);
26 canvas->restore(); 26 canvas->restore();
27 27
28 canvas->concat(zoomOut); 28 canvas->concat(zoomOut);
29 p.setColor(SK_ColorBLUE); 29 p.setColor(SK_ColorBLUE);
30 canvas->saveLayer(layerRect, nullptr); 30 canvas->saveLayer(layerRect, nullptr);
31 canvas->clipRRect(rrect, SkRegion::kIntersect_Op, false); 31 canvas->clipRRect(rrect, SkRegion::kIntersect_Op, false);
32 canvas->drawPaint(p); 32 canvas->drawPaint(p);
33 canvas->restore(); 33 canvas->restore();
34 34
35 static constexpr SkPoint kPts[] = {{0.f, 0.f}, {256.f, 256.f}}; 35 constexpr SkPoint kPts[] = {{0.f, 0.f}, {256.f, 256.f}};
36 static constexpr SkColor kColors1[] = {SK_ColorCYAN, SK_ColorGREEN}; 36 constexpr SkColor kColors1[] = {SK_ColorCYAN, SK_ColorGREEN};
37 p.setShader(SkGradientShader::MakeLinear(kPts, kColors1, nullptr, 2, 37 p.setShader(SkGradientShader::MakeLinear(kPts, kColors1, nullptr, 2,
38 SkShader::kClamp_TileMode)); 38 SkShader::kClamp_TileMode));
39 canvas->concat(zoomOut); 39 canvas->concat(zoomOut);
40 canvas->saveLayer(layerRect, nullptr); 40 canvas->saveLayer(layerRect, nullptr);
41 canvas->clipRRect(rrect, SkRegion::kIntersect_Op, true); 41 canvas->clipRRect(rrect, SkRegion::kIntersect_Op, true);
42 canvas->drawPaint(p); 42 canvas->drawPaint(p);
43 canvas->restore(); 43 canvas->restore();
44 44
45 static constexpr SkColor kColors2[] = {SK_ColorMAGENTA, SK_ColorGRAY}; 45 constexpr SkColor kColors2[] = {SK_ColorMAGENTA, SK_ColorGRAY};
46 p.setShader(SkGradientShader::MakeRadial({128.f, 128.f}, 128.f, kColors2, nu llptr, 2, 46 p.setShader(SkGradientShader::MakeRadial({128.f, 128.f}, 128.f, kColors2, nu llptr, 2,
47 SkShader::kClamp_TileMode)); 47 SkShader::kClamp_TileMode));
48 canvas->concat(zoomOut); 48 canvas->concat(zoomOut);
49 canvas->saveLayer(layerRect, nullptr); 49 canvas->saveLayer(layerRect, nullptr);
50 canvas->clipRRect(rrect, SkRegion::kIntersect_Op, false); 50 canvas->clipRRect(rrect, SkRegion::kIntersect_Op, false);
51 canvas->drawPaint(p); 51 canvas->drawPaint(p);
52 canvas->restore(); 52 canvas->restore();
53 } 53 }
OLDNEW
« no previous file with comments | « gm/rrect.cpp ('k') | gm/rrects.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698