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

Side by Side Diff: src/core/SkSpecialSurface.h

Issue 1913743002: Add another dollop of sk_sp to SkSpecialImage and SkSpecialSurface (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rm std::move Created 4 years, 7 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 | « src/core/SkSpecialImage.cpp ('k') | src/core/SkSpecialSurface.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 2016 Google Inc. 2 * Copyright 2016 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 #ifndef SkSpecialSurface_DEFINED 8 #ifndef SkSpecialSurface_DEFINED
9 #define SkSpecialSurface_DEFINED 9 #define SkSpecialSurface_DEFINED
10 10
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 43
44 /** 44 /**
45 * Returns an image of the current state of the surface pixels up to this 45 * Returns an image of the current state of the surface pixels up to this
46 * point. The canvas returned by 'getCanvas' becomes invalidated by this 46 * point. The canvas returned by 'getCanvas' becomes invalidated by this
47 * call and no more drawing to this surface is allowed. 47 * call and no more drawing to this surface is allowed.
48 * 48 *
49 * Note: the caller inherits a ref from this call that must be balanced 49 * Note: the caller inherits a ref from this call that must be balanced
50 */ 50 */
51 sk_sp<SkSpecialImage> makeImageSnapshot(); 51 sk_sp<SkSpecialImage> makeImageSnapshot();
52 52
53 #if SK_SUPPORT_GPU
53 /** 54 /**
54 * Use an existing (renderTarget-capable) GrTexture as the backing store. 55 * Use an existing (renderTarget-capable) GrTexture as the backing store.
55 */ 56 */
56 static sk_sp<SkSpecialSurface> MakeFromTexture(const SkIRect& subset, GrText ure*, 57 static sk_sp<SkSpecialSurface> MakeFromTexture(const SkIRect& subset, sk_sp< GrTexture>,
57 const SkSurfaceProps* = nullp tr); 58 const SkSurfaceProps* = nullp tr);
58 59
59 /** 60 /**
60 * Allocate a new GPU-backed SkSpecialSurface. If the requested surface can not 61 * Allocate a new GPU-backed SkSpecialSurface. If the requested surface can not
61 * be created, nullptr will be returned. 62 * be created, nullptr will be returned.
62 */ 63 */
63 static sk_sp<SkSpecialSurface> MakeRenderTarget(GrContext*, const GrSurfaceD esc&, 64 static sk_sp<SkSpecialSurface> MakeRenderTarget(GrContext*, const GrSurfaceD esc&,
64 const SkSurfaceProps* = null ptr); 65 const SkSurfaceProps* = null ptr);
66 #endif
65 67
66 /** 68 /**
67 * Use and existing SkBitmap as the backing store. 69 * Use and existing SkBitmap as the backing store.
68 */ 70 */
69 static sk_sp<SkSpecialSurface> MakeFromBitmap(const SkIRect& subset, SkBitma p& bm, 71 static sk_sp<SkSpecialSurface> MakeFromBitmap(const SkIRect& subset, SkBitma p& bm,
70 const SkSurfaceProps* = nullpt r); 72 const SkSurfaceProps* = nullpt r);
71 73
72 /** 74 /**
73 * Return a new CPU-backed surface, with the memory for the pixels automati cally 75 * Return a new CPU-backed surface, with the memory for the pixels automati cally
74 * allocated. 76 * allocated.
(...skipping 12 matching lines...) Expand all
87 const SkIRect& subset() const { return fSubset; } 89 const SkIRect& subset() const { return fSubset; }
88 90
89 private: 91 private:
90 const SkSurfaceProps fProps; 92 const SkSurfaceProps fProps;
91 const SkIRect fSubset; 93 const SkIRect fSubset;
92 94
93 typedef SkRefCnt INHERITED; 95 typedef SkRefCnt INHERITED;
94 }; 96 };
95 97
96 #endif 98 #endif
OLDNEW
« no previous file with comments | « src/core/SkSpecialImage.cpp ('k') | src/core/SkSpecialSurface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698