OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkColorPriv.h" | 10 #include "SkColorPriv.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 fDoFilter = doFilter; | 65 fDoFilter = doFilter; |
66 fDoRotate = doRotate; | 66 fDoRotate = doRotate; |
67 } | 67 } |
68 | 68 |
69 virtual ~GiantBitmapGM() { | 69 virtual ~GiantBitmapGM() { |
70 SkDELETE(fBM); | 70 SkDELETE(fBM); |
71 } | 71 } |
72 | 72 |
73 protected: | 73 protected: |
74 | 74 |
75 SkString onShortName() SK_OVERRIDE { | 75 SkString onShortName() override { |
76 SkString str("giantbitmap_"); | 76 SkString str("giantbitmap_"); |
77 switch (fMode) { | 77 switch (fMode) { |
78 case SkShader::kClamp_TileMode: | 78 case SkShader::kClamp_TileMode: |
79 str.append("clamp"); | 79 str.append("clamp"); |
80 break; | 80 break; |
81 case SkShader::kRepeat_TileMode: | 81 case SkShader::kRepeat_TileMode: |
82 str.append("repeat"); | 82 str.append("repeat"); |
83 break; | 83 break; |
84 case SkShader::kMirror_TileMode: | 84 case SkShader::kMirror_TileMode: |
85 str.append("mirror"); | 85 str.append("mirror"); |
86 break; | 86 break; |
87 default: | 87 default: |
88 break; | 88 break; |
89 } | 89 } |
90 str.append(fDoFilter ? "_bilerp" : "_point"); | 90 str.append(fDoFilter ? "_bilerp" : "_point"); |
91 str.append(fDoRotate ? "_rotate" : "_scale"); | 91 str.append(fDoRotate ? "_rotate" : "_scale"); |
92 return str; | 92 return str; |
93 } | 93 } |
94 | 94 |
95 SkISize onISize() SK_OVERRIDE { return SkISize::Make(640, 480); } | 95 SkISize onISize() override { return SkISize::Make(640, 480); } |
96 | 96 |
97 void onDraw(SkCanvas* canvas) SK_OVERRIDE { | 97 void onDraw(SkCanvas* canvas) override { |
98 SkPaint paint; | 98 SkPaint paint; |
99 | 99 |
100 SkMatrix m; | 100 SkMatrix m; |
101 if (fDoRotate) { | 101 if (fDoRotate) { |
102 // m.setRotate(SkIntToScalar(30), 0, 0); | 102 // m.setRotate(SkIntToScalar(30), 0, 0); |
103 m.setSkew(SK_Scalar1, 0, 0, 0); | 103 m.setSkew(SK_Scalar1, 0, 0, 0); |
104 // m.postScale(2*SK_Scalar1/3, 2*SK_Scalar1/3); | 104 // m.postScale(2*SK_Scalar1/3, 2*SK_Scalar1/3); |
105 } else { | 105 } else { |
106 SkScalar scale = 11*SK_Scalar1/12; | 106 SkScalar scale = 11*SK_Scalar1/12; |
107 m.setScale(scale, scale); | 107 m.setScale(scale, scale); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 static skiagm::GMRegistry reg010(G010); | 144 static skiagm::GMRegistry reg010(G010); |
145 static skiagm::GMRegistry reg110(G110); | 145 static skiagm::GMRegistry reg110(G110); |
146 static skiagm::GMRegistry reg210(G210); | 146 static skiagm::GMRegistry reg210(G210); |
147 | 147 |
148 static skiagm::GMRegistry reg001(G001); | 148 static skiagm::GMRegistry reg001(G001); |
149 static skiagm::GMRegistry reg101(G101); | 149 static skiagm::GMRegistry reg101(G101); |
150 static skiagm::GMRegistry reg201(G201); | 150 static skiagm::GMRegistry reg201(G201); |
151 static skiagm::GMRegistry reg011(G011); | 151 static skiagm::GMRegistry reg011(G011); |
152 static skiagm::GMRegistry reg111(G111); | 152 static skiagm::GMRegistry reg111(G111); |
153 static skiagm::GMRegistry reg211(G211); | 153 static skiagm::GMRegistry reg211(G211); |
OLD | NEW |