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

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

Issue 1631053003: Add SkImage factory method that forces image to be resolved to a texture. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: static->class method Created 4 years, 10 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/image.cpp ('k') | src/image/SkImage.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 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 293
294 /** 294 /**
295 * Return a new image that is a subset of this image. The underlying implem entation may 295 * Return a new image that is a subset of this image. The underlying implem entation may
296 * share the pixels, or it may make a copy. 296 * share the pixels, or it may make a copy.
297 * 297 *
298 * If subset does not intersect the bounds of this image, or the copy/share cannot be made, 298 * If subset does not intersect the bounds of this image, or the copy/share cannot be made,
299 * NULL will be returned. 299 * NULL will be returned.
300 */ 300 */
301 SkImage* newSubset(const SkIRect& subset) const; 301 SkImage* newSubset(const SkIRect& subset) const;
302 302
303 /**
304 * Ensures that an image is backed by a texture (when GrContext is non-null ). If no
305 * transformation is required, the returned image may be the same as this i mage. If the this
306 * image is from a different GrContext, this will fail.
307 */
308 SkImage* newTextureImage(GrContext*) const;
309
303 // Helper functions to convert to SkBitmap 310 // Helper functions to convert to SkBitmap
304 311
305 enum LegacyBitmapMode { 312 enum LegacyBitmapMode {
306 kRO_LegacyBitmapMode, 313 kRO_LegacyBitmapMode,
307 kRW_LegacyBitmapMode, 314 kRW_LegacyBitmapMode,
308 }; 315 };
309 316
310 /** 317 /**
311 * Attempt to create a bitmap with the same pixels as the image. The result will always be 318 * Attempt to create a bitmap with the same pixels as the image. The result will always be
312 * a raster-backed bitmap (texture-backed bitmaps are DEPRECATED, and not s upported here). 319 * a raster-backed bitmap (texture-backed bitmaps are DEPRECATED, and not s upported here).
(...skipping 16 matching lines...) Expand all
329 336
330 private: 337 private:
331 const int fWidth; 338 const int fWidth;
332 const int fHeight; 339 const int fHeight;
333 const uint32_t fUniqueID; 340 const uint32_t fUniqueID;
334 341
335 typedef SkRefCnt INHERITED; 342 typedef SkRefCnt INHERITED;
336 }; 343 };
337 344
338 #endif 345 #endif
OLDNEW
« no previous file with comments | « gm/image.cpp ('k') | src/image/SkImage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698