| 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 "SkBlurMask.h" | 9 #include "SkBlurMask.h" |
| 10 #include "SkBlurMaskFilter.h" | 10 #include "SkBlurMaskFilter.h" |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 return true; | 104 return true; |
| 105 } | 105 } |
| 106 | 106 |
| 107 /** Create a black and white checked bitmap with 2 1-pixel rings around the outs
ide edge. | 107 /** Create a black and white checked bitmap with 2 1-pixel rings around the outs
ide edge. |
| 108 The inner ring is red and the outer ring is blue. */ | 108 The inner ring is red and the outer ring is blue. */ |
| 109 static bool make_ringed_color_bitmap(TestPixels* result, int width, int height)
{ | 109 static bool make_ringed_color_bitmap(TestPixels* result, int width, int height)
{ |
| 110 static const SkPMColor kBlue = SkPreMultiplyColor(SK_ColorBLUE); | 110 static const SkPMColor kBlue = SkPreMultiplyColor(SK_ColorBLUE); |
| 111 static const SkPMColor kRed = SkPreMultiplyColor(SK_ColorRED); | 111 static const SkPMColor kRed = SkPreMultiplyColor(SK_ColorRED); |
| 112 static const SkPMColor kBlack = SkPreMultiplyColor(SK_ColorBLACK); | 112 static const SkPMColor kBlack = SkPreMultiplyColor(SK_ColorBLACK); |
| 113 static const SkPMColor kWhite = SkPreMultiplyColor(SK_ColorWHITE); | 113 static const SkPMColor kWhite = SkPreMultiplyColor(SK_ColorWHITE); |
| 114 return make_ringed_bitmap<SkPMColor>(result, width, height, kBGRA_8888_SkCol
orType, | 114 return make_ringed_bitmap<SkPMColor>(result, width, height, kN32_SkColorType
, |
| 115 kPremul_SkAlphaType, kBlue, kRed, kBlac
k, kWhite); | 115 kPremul_SkAlphaType, kBlue, kRed, kBlac
k, kWhite); |
| 116 } | 116 } |
| 117 | 117 |
| 118 /** Makes a alpha bitmap with 1 wide rect/ring of 0s, an inset of 1s, and the in
terior is a 2x2 | 118 /** Makes a alpha bitmap with 1 wide rect/ring of 0s, an inset of 1s, and the in
terior is a 2x2 |
| 119 checker board of 3/4 and 1/2. The inner checkers are large enough to fill th
e interior with | 119 checker board of 3/4 and 1/2. The inner checkers are large enough to fill th
e interior with |
| 120 the 2x2 checker grid. */ | 120 the 2x2 checker grid. */ |
| 121 static bool make_ringed_alpha_bitmap(TestPixels* result, int width, int height)
{ | 121 static bool make_ringed_alpha_bitmap(TestPixels* result, int width, int height)
{ |
| 122 static const uint8_t kZero = 0x00; | 122 static const uint8_t kZero = 0x00; |
| 123 static const uint8_t kHalf = 0x80; | 123 static const uint8_t kHalf = 0x80; |
| 124 static const uint8_t k3Q = 0xC0; | 124 static const uint8_t k3Q = 0xC0; |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 // now blow up the 1 pixel result | 504 // now blow up the 1 pixel result |
| 505 canvas->drawImageRect(surf->makeImageSnapshot(), SkRect::MakeWH(100,
100), nullptr); | 505 canvas->drawImageRect(surf->makeImageSnapshot(), SkRect::MakeWH(100,
100), nullptr); |
| 506 canvas->translate(120, 0); | 506 canvas->translate(120, 0); |
| 507 } | 507 } |
| 508 canvas->restore(); | 508 canvas->restore(); |
| 509 canvas->translate(0, 120); | 509 canvas->translate(0, 120); |
| 510 } | 510 } |
| 511 } | 511 } |
| 512 | 512 |
| 513 | 513 |
| OLD | NEW |