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

Unified Diff: src/gpu/GrImageIDTextureAdjuster.cpp

Issue 1249543003: Creating functions for uploading a mipmapped texture. (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Rebasing. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrImageIDTextureAdjuster.h ('k') | src/gpu/GrSurface.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrImageIDTextureAdjuster.cpp
diff --git a/src/gpu/GrImageIDTextureAdjuster.cpp b/src/gpu/GrImageIDTextureAdjuster.cpp
index 2edff60553c2118466f5e11773bf87781309ba77..58dc5b975b821c8958e25956b3a92763fec1a66b 100644
--- a/src/gpu/GrImageIDTextureAdjuster.cpp
+++ b/src/gpu/GrImageIDTextureAdjuster.cpp
@@ -81,7 +81,7 @@ GrBitmapTextureMaker::GrBitmapTextureMaker(GrContext* context, const SkBitmap& b
}
}
-GrTexture* GrBitmapTextureMaker::refOriginalTexture() {
+GrTexture* GrBitmapTextureMaker::refOriginalTexture(bool willBeMipped) {
GrTexture* tex;
if (fOriginalKey.isValid()) {
@@ -91,7 +91,11 @@ GrTexture* GrBitmapTextureMaker::refOriginalTexture() {
}
}
- tex = GrUploadBitmapToTexture(this->context(), fBitmap);
+ if (willBeMipped) {
+ tex = GrGenerateMipMapsAndUploadToTexture(this->context(), fBitmap);
+ } else {
+ tex = GrUploadBitmapToTexture(this->context(), fBitmap);
+ }
if (tex && fOriginalKey.isValid()) {
tex->resourcePriv().setUniqueKey(fOriginalKey);
GrInstallBitmapUniqueKeyInvalidator(fOriginalKey, fBitmap.pixelRef());
@@ -126,8 +130,8 @@ GrImageTextureMaker::GrImageTextureMaker(GrContext* context, SkImageCacherator*
}
}
-GrTexture* GrImageTextureMaker::refOriginalTexture() {
- return fCacher->lockTexture(this->context(), fOriginalKey, fClient, fCachingHint);
+GrTexture* GrImageTextureMaker::refOriginalTexture(bool willBeMipped) {
+ return fCacher->lockTexture(this->context(), fOriginalKey, fClient, fCachingHint, willBeMipped);
}
void GrImageTextureMaker::makeCopyKey(const CopyParams& stretch, GrUniqueKey* paramsCopyKey) {
« no previous file with comments | « src/gpu/GrImageIDTextureAdjuster.h ('k') | src/gpu/GrSurface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698