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

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

Issue 2115023002: Store mipmap levels in deferred texture image (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Updating call sites. Created 4 years, 4 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/deferredtextureimagedata.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 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 * to create deferred texture data for this image (or zero if this is an ina ppropriate 389 * to create deferred texture data for this image (or zero if this is an ina ppropriate
390 * candidate). The buffer allocated by the client should be 8 byte aligned. 390 * candidate). The buffer allocated by the client should be 8 byte aligned.
391 * 391 *
392 * When buffer is not null this fills in the deferred texture data for this image in the 392 * When buffer is not null this fills in the deferred texture data for this image in the
393 * provided buffer (assuming this is an appropriate candidate image and the buffer is 393 * provided buffer (assuming this is an appropriate candidate image and the buffer is
394 * appropriately aligned). Upon success the size written is returned, otherw ise 0. 394 * appropriately aligned). Upon success the size written is returned, otherw ise 0.
395 */ 395 */
396 size_t getDeferredTextureImageData(const GrContextThreadSafeProxy&, 396 size_t getDeferredTextureImageData(const GrContextThreadSafeProxy&,
397 const DeferredTextureImageUsageParams[], 397 const DeferredTextureImageUsageParams[],
398 int paramCnt, 398 int paramCnt,
399 void* buffer) const; 399 void* buffer,
400 SkSourceGammaTreatment treatment =
401 SkSourceGammaTreatment::kIgnore) const;
400 402
401 /** 403 /**
402 * Returns a texture-backed image from data produced in SkImage::getDeferred TextureImageData. 404 * Returns a texture-backed image from data produced in SkImage::getDeferred TextureImageData.
403 * The context must be the context that provided the proxy passed to 405 * The context must be the context that provided the proxy passed to
404 * getDeferredTextureImageData. 406 * getDeferredTextureImageData.
405 */ 407 */
406 static sk_sp<SkImage> MakeFromDeferredTextureImageData(GrContext*, const voi d*, SkBudgeted); 408 static sk_sp<SkImage> MakeFromDeferredTextureImageData(GrContext*, const voi d*, SkBudgeted);
407 409
408 // Helper functions to convert to SkBitmap 410 // Helper functions to convert to SkBitmap
409 411
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 SkImage* newSubset(const SkIRect& subset) const { return this->makeSubset(su bset).release(); } 464 SkImage* newSubset(const SkIRect& subset) const { return this->makeSubset(su bset).release(); }
463 SkImage* newTextureImage(GrContext* ctx) const { return this->makeTextureIma ge(ctx).release(); } 465 SkImage* newTextureImage(GrContext* ctx) const { return this->makeTextureIma ge(ctx).release(); }
464 #endif 466 #endif
465 467
466 protected: 468 protected:
467 SkImage(int width, int height, uint32_t uniqueID); 469 SkImage(int width, int height, uint32_t uniqueID);
468 470
469 private: 471 private:
470 static sk_sp<SkImage> MakeTextureFromMipMap(GrContext*, const SkImageInfo&, 472 static sk_sp<SkImage> MakeTextureFromMipMap(GrContext*, const SkImageInfo&,
471 const GrMipLevel* texels, int mi pLevelCount, 473 const GrMipLevel* texels, int mi pLevelCount,
472 SkBudgeted); 474 SkBudgeted, SkSourceGammaTreatme nt);
473 475
474 const int fWidth; 476 const int fWidth;
475 const int fHeight; 477 const int fHeight;
476 const uint32_t fUniqueID; 478 const uint32_t fUniqueID;
477 479
478 typedef SkRefCnt INHERITED; 480 typedef SkRefCnt INHERITED;
479 }; 481 };
480 482
481 #endif 483 #endif
OLDNEW
« no previous file with comments | « gm/deferredtextureimagedata.cpp ('k') | src/image/SkImage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698