| 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 15 matching lines...) Expand all Loading... |
| 26 uint32_t flags = 0; | 26 uint32_t flags = 0; |
| 27 if (disallowAA) { | 27 if (disallowAA) { |
| 28 flags |= SkSurfaceProps::kDisallowAntiAlias_Flag; | 28 flags |= SkSurfaceProps::kDisallowAntiAlias_Flag; |
| 29 } | 29 } |
| 30 if (disallowDither) { | 30 if (disallowDither) { |
| 31 flags |= SkSurfaceProps::kDisallowDither_Flag; | 31 flags |= SkSurfaceProps::kDisallowDither_Flag; |
| 32 } | 32 } |
| 33 | 33 |
| 34 SkSurfaceProps props(flags, geo); | 34 SkSurfaceProps props(flags, geo); |
| 35 if (ctx) { | 35 if (ctx) { |
| 36 return SkSurface::NewRenderTarget(ctx, SkBudgeted::kNo, info, 0, &props)
; | 36 return SkSurface::NewRenderTarget(ctx, SkSurface::kNo_Budgeted, info, 0,
&props); |
| 37 } else { | 37 } else { |
| 38 return SkSurface::NewRaster(info, &props); | 38 return SkSurface::NewRaster(info, &props); |
| 39 } | 39 } |
| 40 } | 40 } |
| 41 | 41 |
| 42 static void test_draw(SkCanvas* canvas, const char label[]) { | 42 static void test_draw(SkCanvas* canvas, const char label[]) { |
| 43 SkPaint paint; | 43 SkPaint paint; |
| 44 | 44 |
| 45 paint.setAntiAlias(true); | 45 paint.setAntiAlias(true); |
| 46 paint.setLCDRenderText(true); | 46 paint.setLCDRenderText(true); |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 | 151 |
| 152 SkAutoTUnref<SkImage> image2(surf2->newImageSnapshot()); | 152 SkAutoTUnref<SkImage> image2(surf2->newImageSnapshot()); |
| 153 canvas->drawImage(image2, 10 + SkIntToScalar(image->width()) + 10, 10, n
ullptr); | 153 canvas->drawImage(image2, 10 + SkIntToScalar(image->width()) + 10, 10, n
ullptr); |
| 154 } | 154 } |
| 155 | 155 |
| 156 private: | 156 private: |
| 157 typedef GM INHERITED; | 157 typedef GM INHERITED; |
| 158 }; | 158 }; |
| 159 DEF_GM( return new NewSurfaceGM ) | 159 DEF_GM( return new NewSurfaceGM ) |
| 160 | 160 |
| OLD | NEW |