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

Side by Side Diff: include/core/SkImage.h

Issue 1785473002: SkImage now has makeShader to return sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: use build guard for impl of newShader 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/rectangletexture.cpp ('k') | samplecode/SampleFilterQuality.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 2012 Google Inc. 2 * Copyright 2012 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 SkImage_DEFINED 8 #ifndef SkImage_DEFINED
9 #define SkImage_DEFINED 9 #define SkImage_DEFINED
10 10
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 uint32_t uniqueID() const { return fUniqueID; } 156 uint32_t uniqueID() const { return fUniqueID; }
157 virtual bool isOpaque() const { return false; } 157 virtual bool isOpaque() const { return false; }
158 158
159 /** 159 /**
160 * Extracts YUV planes from the SkImage and stores them in client-provided m emory. The sizes 160 * Extracts YUV planes from the SkImage and stores them in client-provided m emory. The sizes
161 * planes and rowBytes arrays are ordered [y, u, v]. 161 * planes and rowBytes arrays are ordered [y, u, v].
162 */ 162 */
163 bool readYUV8Planes(const SkISize[3], void* const planes[3], const size_t ro wBytes[3], 163 bool readYUV8Planes(const SkISize[3], void* const planes[3], const size_t ro wBytes[3],
164 SkYUVColorSpace) const; 164 SkYUVColorSpace) const;
165 165
166 virtual SkShader* newShader(SkShader::TileMode, 166 #ifdef SK_SUPPORT_LEGACY_CREATESHADER_PTR
167 SkShader::TileMode, 167 SkShader* newShader(SkShader::TileMode, SkShader::TileMode,
168 const SkMatrix* localMatrix = NULL) const; 168 const SkMatrix* localMatrix = nullptr) const;
169 #endif
170
171 sk_sp<SkShader> makeShader(SkShader::TileMode, SkShader::TileMode,
172 const SkMatrix* localMatrix = nullptr) const;
169 173
170 /** 174 /**
171 * If the image has direct access to its pixels (i.e. they are in local 175 * If the image has direct access to its pixels (i.e. they are in local
172 * RAM) return the (const) address of those pixels, and if not null, return 176 * RAM) return the (const) address of those pixels, and if not null, return
173 * the ImageInfo and rowBytes. The returned address is only valid while 177 * the ImageInfo and rowBytes. The returned address is only valid while
174 * the image object is in scope. 178 * the image object is in scope.
175 * 179 *
176 * On failure, returns NULL and the info and rowBytes parameters are 180 * On failure, returns NULL and the info and rowBytes parameters are
177 * ignored. 181 * ignored.
178 */ 182 */
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 349
346 private: 350 private:
347 const int fWidth; 351 const int fWidth;
348 const int fHeight; 352 const int fHeight;
349 const uint32_t fUniqueID; 353 const uint32_t fUniqueID;
350 354
351 typedef SkRefCnt INHERITED; 355 typedef SkRefCnt INHERITED;
352 }; 356 };
353 357
354 #endif 358 #endif
OLDNEW
« no previous file with comments | « gm/rectangletexture.cpp ('k') | samplecode/SampleFilterQuality.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698