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

Side by Side Diff: src/gpu/GrTextureParamsAdjuster.cpp

Issue 1411323002: Upload stretched bmp rather than original after doing CPU stretch for min texture size (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 2 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 | « no previous file | no next file » | 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 2015 Google Inc. 2 * Copyright 2015 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 #include "GrTextureParamsAdjuster.h" 8 #include "GrTextureParamsAdjuster.h"
9 9
10 #include "GrCaps.h" 10 #include "GrCaps.h"
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 if (this->width() < ctx->caps()->minTextureSize() || 134 if (this->width() < ctx->caps()->minTextureSize() ||
135 this->height() < ctx->caps()->minTextureSize()) 135 this->height() < ctx->caps()->minTextureSize())
136 { 136 {
137 // we can't trust our ability to use HW to perform the stretch, so we re quest 137 // we can't trust our ability to use HW to perform the stretch, so we re quest
138 // a raster instead, and perform the stretch on the CPU. 138 // a raster instead, and perform the stretch on the CPU.
139 SkBitmap bitmap; 139 SkBitmap bitmap;
140 if (!this->getROBitmap(&bitmap)) { 140 if (!this->getROBitmap(&bitmap)) {
141 return nullptr; 141 return nullptr;
142 } 142 }
143 SkBitmap stretchedBmp = copy_on_cpu(bitmap, copyParams); 143 SkBitmap stretchedBmp = copy_on_cpu(bitmap, copyParams);
144 return GrUploadBitmapToTexture(ctx, bitmap); 144 return GrUploadBitmapToTexture(ctx, stretchedBmp);
145 } else { 145 } else {
146 SkAutoTUnref<GrTexture> original(this->refOriginalTexture(ctx)); 146 SkAutoTUnref<GrTexture> original(this->refOriginalTexture(ctx));
147 if (!original) { 147 if (!original) {
148 return nullptr; 148 return nullptr;
149 } 149 }
150 return copy_on_gpu(original, copyParams); 150 return copy_on_gpu(original, copyParams);
151 } 151 }
152 } 152 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698