| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 "SkGradientShader.h" | 9 #include "SkGradientShader.h" |
| 10 #include "SkSurface.h" | 10 #include "SkSurface.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 paint.setLCDRenderText(true); | 46 paint.setLCDRenderText(true); |
| 47 paint.setDither(true); | 47 paint.setDither(true); |
| 48 | 48 |
| 49 paint.setShader(make_shader())->unref(); | 49 paint.setShader(make_shader())->unref(); |
| 50 canvas->drawRect(SkRect::MakeWH(W, H), paint); | 50 canvas->drawRect(SkRect::MakeWH(W, H), paint); |
| 51 paint.setShader(NULL); | 51 paint.setShader(NULL); |
| 52 | 52 |
| 53 paint.setColor(SK_ColorWHITE); | 53 paint.setColor(SK_ColorWHITE); |
| 54 paint.setTextSize(32); | 54 paint.setTextSize(32); |
| 55 paint.setTextAlign(SkPaint::kCenter_Align); | 55 paint.setTextAlign(SkPaint::kCenter_Align); |
| 56 sk_tool_utils::set_portable_typeface(&paint); |
| 56 canvas->drawText(label, strlen(label), W / 2, H * 3 / 4, paint); | 57 canvas->drawText(label, strlen(label), W / 2, H * 3 / 4, paint); |
| 57 } | 58 } |
| 58 | 59 |
| 59 class SurfacePropsGM : public skiagm::GM { | 60 class SurfacePropsGM : public skiagm::GM { |
| 60 public: | 61 public: |
| 61 SurfacePropsGM() {} | 62 SurfacePropsGM() {} |
| 62 | 63 |
| 63 protected: | 64 protected: |
| 64 SkString onShortName() override { | 65 SkString onShortName() override { |
| 65 return SkString("surfaceprops"); | 66 return SkString("surfaceprops"); |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 | 151 |
| 151 SkAutoTUnref<SkImage> image2(surf2->newImageSnapshot()); | 152 SkAutoTUnref<SkImage> image2(surf2->newImageSnapshot()); |
| 152 canvas->drawImage(image2, 10 + SkIntToScalar(image->width()) + 10, 10, N
ULL); | 153 canvas->drawImage(image2, 10 + SkIntToScalar(image->width()) + 10, 10, N
ULL); |
| 153 } | 154 } |
| 154 | 155 |
| 155 private: | 156 private: |
| 156 typedef GM INHERITED; | 157 typedef GM INHERITED; |
| 157 }; | 158 }; |
| 158 DEF_GM( return new NewSurfaceGM ) | 159 DEF_GM( return new NewSurfaceGM ) |
| 159 | 160 |
| OLD | NEW |