Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(350)

Side by Side Diff: gm/color4f.cpp

Issue 1817383002: switch surface to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gm/bigtileimagefilter.cpp ('k') | gm/complexclip_blur_tiled.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « gm/bigtileimagefilter.cpp ('k') | gm/complexclip_blur_tiled.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698