| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "SkColorPriv.h" | 9 #include "SkColorPriv.h" |
| 10 #include "SkGradientShader.h" | 10 #include "SkGradientShader.h" |
| 11 #include "SkImage.h" | 11 #include "SkImage.h" |
| 12 #include "SkMathPriv.h" |
| 12 #include "SkRandom.h" | 13 #include "SkRandom.h" |
| 13 #include "SkShader.h" | 14 #include "SkShader.h" |
| 14 #include "SkSurface.h" | 15 #include "SkSurface.h" |
| 15 | 16 |
| 16 static sk_sp<SkImage> makebm(SkCanvas* caller, int w, int h) { | 17 static sk_sp<SkImage> makebm(SkCanvas* caller, int w, int h) { |
| 17 SkImageInfo info = SkImageInfo::MakeN32Premul(w, h); | 18 SkImageInfo info = SkImageInfo::MakeN32Premul(w, h); |
| 18 auto surface(caller->makeSurface(info)); | 19 auto surface(caller->makeSurface(info)); |
| 19 if (nullptr == surface) { | 20 if (nullptr == surface) { |
| 20 surface = SkSurface::MakeRaster(info); | 21 surface = SkSurface::MakeRaster(info); |
| 21 } | 22 } |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 private: | 134 private: |
| 134 bool fAA; | 135 bool fAA; |
| 135 sk_sp<SkImage> fImage; | 136 sk_sp<SkImage> fImage; |
| 136 SkString fName; | 137 SkString fName; |
| 137 | 138 |
| 138 typedef skiagm::GM INHERITED; | 139 typedef skiagm::GM INHERITED; |
| 139 }; | 140 }; |
| 140 | 141 |
| 141 DEF_GM( return new DrawMiniBitmapRectGM(true); ) | 142 DEF_GM( return new DrawMiniBitmapRectGM(true); ) |
| 142 DEF_GM( return new DrawMiniBitmapRectGM(false); ) | 143 DEF_GM( return new DrawMiniBitmapRectGM(false); ) |
| OLD | NEW |