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/SkGpuDevice.cpp

Issue 1249543003: Creating functions for uploading a mipmapped texture. (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Cleaning up the allocated SkMipMap object. Created 4 years, 11 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
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 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 "SkGpuDevice.h" 8 #include "SkGpuDevice.h"
9 9
10 #include "GrBlurUtils.h" 10 #include "GrBlurUtils.h"
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 at = kPremul_SkAlphaType; // force this setting 210 at = kPremul_SkAlphaType; // force this setting
211 } 211 }
212 const SkImageInfo info = SkImageInfo::Make(origInfo.width(), origInfo.height (), ct, at); 212 const SkImageInfo info = SkImageInfo::Make(origInfo.width(), origInfo.height (), ct, at);
213 213
214 GrSurfaceDesc desc; 214 GrSurfaceDesc desc;
215 desc.fFlags = kRenderTarget_GrSurfaceFlag; 215 desc.fFlags = kRenderTarget_GrSurfaceFlag;
216 desc.fWidth = info.width(); 216 desc.fWidth = info.width();
217 desc.fHeight = info.height(); 217 desc.fHeight = info.height();
218 desc.fConfig = SkImageInfo2GrPixelConfig(info); 218 desc.fConfig = SkImageInfo2GrPixelConfig(info);
219 desc.fSampleCnt = sampleCount; 219 desc.fSampleCnt = sampleCount;
220 desc.fIsMipMapped = false;
220 GrTexture* texture = context->textureProvider()->createTexture( 221 GrTexture* texture = context->textureProvider()->createTexture(
221 desc, SkToBool(budgeted), nullptr, 0); 222 desc, SkToBool(budgeted), nullptr, 0);
222 if (nullptr == texture) { 223 if (nullptr == texture) {
223 return nullptr; 224 return nullptr;
224 } 225 }
225 SkASSERT(nullptr != texture->asRenderTarget()); 226 SkASSERT(nullptr != texture->asRenderTarget());
226 return texture->asRenderTarget(); 227 return texture->asRenderTarget();
227 } 228 }
228 229
229 /////////////////////////////////////////////////////////////////////////////// 230 ///////////////////////////////////////////////////////////////////////////////
(...skipping 1670 matching lines...) Expand 10 before | Expand all | Expand 10 after
1900 } 1901 }
1901 1902
1902 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { 1903 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() {
1903 ASSERT_SINGLE_OWNER 1904 ASSERT_SINGLE_OWNER
1904 // We always return a transient cache, so it is freed after each 1905 // We always return a transient cache, so it is freed after each
1905 // filter traversal. 1906 // filter traversal.
1906 return SkGpuDevice::NewImageFilterCache(); 1907 return SkGpuDevice::NewImageFilterCache();
1907 } 1908 }
1908 1909
1909 #endif 1910 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698