OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "SkBitmap.h" | 9 #include "SkBitmap.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 | 102 |
103 namespace skiagm { | 103 namespace skiagm { |
104 | 104 |
105 class BitmapPremulGM : public GM { | 105 class BitmapPremulGM : public GM { |
106 public: | 106 public: |
107 BitmapPremulGM() { | 107 BitmapPremulGM() { |
108 this->setBGColor(SK_ColorWHITE); | 108 this->setBGColor(SK_ColorWHITE); |
109 } | 109 } |
110 | 110 |
111 protected: | 111 protected: |
112 SkString onShortName() SK_OVERRIDE { | 112 SkString onShortName() override { |
113 return SkString("bitmap_premul"); | 113 return SkString("bitmap_premul"); |
114 } | 114 } |
115 | 115 |
116 SkISize onISize() SK_OVERRIDE { | 116 SkISize onISize() override { |
117 return SkISize::Make(SLIDE_SIZE * 2, SLIDE_SIZE * 2); | 117 return SkISize::Make(SLIDE_SIZE * 2, SLIDE_SIZE * 2); |
118 } | 118 } |
119 | 119 |
120 void onDraw(SkCanvas* canvas) SK_OVERRIDE { | 120 void onDraw(SkCanvas* canvas) override { |
121 SkScalar slideSize = SkIntToScalar(SLIDE_SIZE); | 121 SkScalar slideSize = SkIntToScalar(SLIDE_SIZE); |
122 canvas->drawBitmap(make_argb8888_gradient(), 0, 0); | 122 canvas->drawBitmap(make_argb8888_gradient(), 0, 0); |
123 canvas->drawBitmap(make_argb4444_gradient(), slideSize, 0); | 123 canvas->drawBitmap(make_argb4444_gradient(), slideSize, 0); |
124 canvas->drawBitmap(make_argb8888_stripes(), 0, slideSize); | 124 canvas->drawBitmap(make_argb8888_stripes(), 0, slideSize); |
125 canvas->drawBitmap(make_argb4444_stripes(), slideSize, slideSize); | 125 canvas->drawBitmap(make_argb4444_stripes(), slideSize, slideSize); |
126 } | 126 } |
127 | 127 |
128 private: | 128 private: |
129 typedef GM INHERITED; | 129 typedef GM INHERITED; |
130 }; | 130 }; |
131 | 131 |
132 DEF_GM( return new BitmapPremulGM; ) | 132 DEF_GM( return new BitmapPremulGM; ) |
133 } | 133 } |
OLD | NEW |