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

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

Issue 2034933003: Store mipmap levels in deferred texture image (Closed) Base URL: https://skia.googlesource.com/skia.git@pipe-mipmap-levels-to-creation
Patch Set: Using scaled size. Created 4 years, 6 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/deferredtextureimage.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 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 * to create deferred texture data for this image (or zero if this is an ina ppropriate 377 * to create deferred texture data for this image (or zero if this is an ina ppropriate
378 * candidate). The buffer allocated by the client should be 8 byte aligned. 378 * candidate). The buffer allocated by the client should be 8 byte aligned.
379 * 379 *
380 * When buffer is not null this fills in the deferred texture data for this image in the 380 * When buffer is not null this fills in the deferred texture data for this image in the
381 * provided buffer (assuming this is an appropriate candidate image and the buffer is 381 * provided buffer (assuming this is an appropriate candidate image and the buffer is
382 * appropriately aligned). Upon success the size written is returned, otherw ise 0. 382 * appropriately aligned). Upon success the size written is returned, otherw ise 0.
383 */ 383 */
384 size_t getDeferredTextureImageData(const GrContextThreadSafeProxy&, 384 size_t getDeferredTextureImageData(const GrContextThreadSafeProxy&,
385 const DeferredTextureImageUsageParams[], 385 const DeferredTextureImageUsageParams[],
386 int paramCnt, 386 int paramCnt,
387 void* buffer) const; 387 void* buffer,
388 SkSourceGammaTreatment treatment =
389 SkSourceGammaTreatment::kIgnore) const;
388 390
389 /** 391 /**
390 * Returns a texture-backed image from data produced in SkImage::getDeferred TextureImageData. 392 * Returns a texture-backed image from data produced in SkImage::getDeferred TextureImageData.
391 * The context must be the context that provided the proxy passed to 393 * The context must be the context that provided the proxy passed to
392 * getDeferredTextureImageData. 394 * getDeferredTextureImageData.
393 */ 395 */
394 static sk_sp<SkImage> MakeFromDeferredTextureImageData(GrContext*, const voi d*, SkBudgeted); 396 static sk_sp<SkImage> MakeFromDeferredTextureImageData(GrContext*, const voi d*, SkBudgeted);
395 397
396 // Helper functions to convert to SkBitmap 398 // Helper functions to convert to SkBitmap
397 399
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 SkImage* newSubset(const SkIRect& subset) const { return this->makeSubset(su bset).release(); } 454 SkImage* newSubset(const SkIRect& subset) const { return this->makeSubset(su bset).release(); }
453 SkImage* newTextureImage(GrContext* ctx) const { return this->makeTextureIma ge(ctx).release(); } 455 SkImage* newTextureImage(GrContext* ctx) const { return this->makeTextureIma ge(ctx).release(); }
454 #endif 456 #endif
455 457
456 protected: 458 protected:
457 SkImage(int width, int height, uint32_t uniqueID); 459 SkImage(int width, int height, uint32_t uniqueID);
458 460
459 private: 461 private:
460 static sk_sp<SkImage> MakeTextureFromMipMap(GrContext*, const SkImageInfo&, 462 static sk_sp<SkImage> MakeTextureFromMipMap(GrContext*, const SkImageInfo&,
461 const GrMipLevel* texels, int mi pLevelCount, 463 const GrMipLevel* texels, int mi pLevelCount,
462 SkBudgeted); 464 SkBudgeted, SkSourceGammaTreatme nt);
463 465
464 const int fWidth; 466 const int fWidth;
465 const int fHeight; 467 const int fHeight;
466 const uint32_t fUniqueID; 468 const uint32_t fUniqueID;
467 469
468 typedef SkRefCnt INHERITED; 470 typedef SkRefCnt INHERITED;
469 }; 471 };
470 472
471 #endif 473 #endif
OLDNEW
« no previous file with comments | « gm/deferredtextureimage.cpp ('k') | src/image/SkImage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698