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

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

Issue 459263003: Add a parameter GR_ALWAYS_ALLOCATE_ON_HEAP to allow for only ever creating temporary buffers on the… (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Build fixes Created 6 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 | « include/gpu/GrTypes.h ('k') | src/gpu/GrTextStrike.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 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #include "GrContext.h" 10 #include "GrContext.h"
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 371
372 rtDesc.fFlags = kNone_GrTextureFlags; 372 rtDesc.fFlags = kNone_GrTextureFlags;
373 // no longer need to clamp at min RT size. 373 // no longer need to clamp at min RT size.
374 rtDesc.fWidth = GrNextPow2(desc.fWidth); 374 rtDesc.fWidth = GrNextPow2(desc.fWidth);
375 rtDesc.fHeight = GrNextPow2(desc.fHeight); 375 rtDesc.fHeight = GrNextPow2(desc.fHeight);
376 376
377 // We shouldn't be resizing a compressed texture. 377 // We shouldn't be resizing a compressed texture.
378 SkASSERT(!GrPixelConfigIsCompressed(desc.fConfig)); 378 SkASSERT(!GrPixelConfigIsCompressed(desc.fConfig));
379 379
380 size_t bpp = GrBytesPerPixel(desc.fConfig); 380 size_t bpp = GrBytesPerPixel(desc.fConfig);
381 SkAutoSMalloc<128*128*4> stretchedPixels(bpp * rtDesc.fWidth * rtDesc.fH eight); 381 GrAutoMalloc<128*128*4> stretchedPixels(bpp * rtDesc.fWidth * rtDesc.fHe ight);
382 stretch_image(stretchedPixels.get(), rtDesc.fWidth, rtDesc.fHeight, 382 stretch_image(stretchedPixels.get(), rtDesc.fWidth, rtDesc.fHeight,
383 srcData, desc.fWidth, desc.fHeight, bpp); 383 srcData, desc.fWidth, desc.fHeight, bpp);
384 384
385 size_t stretchedRowBytes = rtDesc.fWidth * bpp; 385 size_t stretchedRowBytes = rtDesc.fWidth * bpp;
386 386
387 texture = fGpu->createTexture(rtDesc, stretchedPixels.get(), stretchedRo wBytes); 387 texture = fGpu->createTexture(rtDesc, stretchedPixels.get(), stretchedRo wBytes);
388 SkASSERT(NULL != texture); 388 SkASSERT(NULL != texture);
389 } 389 }
390 390
391 return texture; 391 return texture;
(...skipping 1524 matching lines...) Expand 10 before | Expand all | Expand 10 after
1916 fDrawBuffer->removeGpuTraceMarker(marker); 1916 fDrawBuffer->removeGpuTraceMarker(marker);
1917 } 1917 }
1918 } 1918 }
1919 1919
1920 /////////////////////////////////////////////////////////////////////////////// 1920 ///////////////////////////////////////////////////////////////////////////////
1921 #if GR_CACHE_STATS 1921 #if GR_CACHE_STATS
1922 void GrContext::printCacheStats() const { 1922 void GrContext::printCacheStats() const {
1923 fResourceCache->printStats(); 1923 fResourceCache->printStats();
1924 } 1924 }
1925 #endif 1925 #endif
OLDNEW
« no previous file with comments | « include/gpu/GrTypes.h ('k') | src/gpu/GrTextStrike.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698