| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 "SkCanvas.h" | 9 #include "SkCanvas.h" |
| 10 #include "SkColorPriv.h" | 10 #include "SkColorPriv.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 | 70 |
| 71 SkPaint bg; | 71 SkPaint bg; |
| 72 // need the target to be opaque, so we can draw it to the screen | 72 // need the target to be opaque, so we can draw it to the screen |
| 73 // even if it holds sRGB values. | 73 // even if it holds sRGB values. |
| 74 bg.setColor(0xFFFFFFFF); | 74 bg.setColor(0xFFFFFFFF); |
| 75 | 75 |
| 76 SkColorProfileType const profiles[] { kLinear_SkColorProfileType, kSRGB_SkCo
lorProfileType }; | 76 SkColorProfileType const profiles[] { kLinear_SkColorProfileType, kSRGB_SkCo
lorProfileType }; |
| 77 for (auto profile : profiles) { | 77 for (auto profile : profiles) { |
| 78 const SkImageInfo info = SkImageInfo::Make(1024, 100, kN32_SkColorType,
kPremul_SkAlphaType, | 78 const SkImageInfo info = SkImageInfo::Make(1024, 100, kN32_SkColorType,
kPremul_SkAlphaType, |
| 79 profile); | 79 profile); |
| 80 SkAutoTUnref<SkSurface> surface(SkSurface::NewRaster(info)); | 80 auto surface(SkSurface::MakeRaster(info)); |
| 81 surface->getCanvas()->drawPaint(bg); | 81 surface->getCanvas()->drawPaint(bg); |
| 82 draw_into_canvas(surface->getCanvas()); | 82 draw_into_canvas(surface->getCanvas()); |
| 83 surface->draw(canvas, 0, 0, nullptr); | 83 surface->draw(canvas, 0, 0, nullptr); |
| 84 canvas->translate(0, 120); | 84 canvas->translate(0, 120); |
| 85 } | 85 } |
| 86 } | 86 } |
| OLD | NEW |