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

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

Issue 1728093005: Move Budgeted enum out of SkSurface, use in GrTextureProvider (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add aliases for Chrome Created 4 years, 9 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 | « src/effects/SkColorCubeFilter.cpp ('k') | src/gpu/GrGpu.h » ('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 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 "GrContext.h" 8 #include "GrContext.h"
9 #include "GrContextOptions.h" 9 #include "GrContextOptions.h"
10 #include "GrDrawingManager.h" 10 #include "GrDrawingManager.h"
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 if (GrGpu::kNoDraw_DrawPreference != drawPreference) { 416 if (GrGpu::kNoDraw_DrawPreference != drawPreference) {
417 if (tempDrawInfo.fUseExactScratch) { 417 if (tempDrawInfo.fUseExactScratch) {
418 // We only respect this when the entire src is being read. Otherwise we can trigger too 418 // We only respect this when the entire src is being read. Otherwise we can trigger too
419 // many odd ball texture sizes and trash the cache. 419 // many odd ball texture sizes and trash the cache.
420 if (width != src->width() || height != src->height()) { 420 if (width != src->width() || height != src->height()) {
421 tempDrawInfo.fUseExactScratch = false; 421 tempDrawInfo.fUseExactScratch = false;
422 } 422 }
423 } 423 }
424 SkAutoTUnref<GrTexture> temp; 424 SkAutoTUnref<GrTexture> temp;
425 if (tempDrawInfo.fUseExactScratch) { 425 if (tempDrawInfo.fUseExactScratch) {
426 temp.reset(this->textureProvider()->createTexture(tempDrawInfo.fTemp SurfaceDesc, true)); 426 temp.reset(this->textureProvider()->createTexture(tempDrawInfo.fTemp SurfaceDesc,
427 SkBudgeted::kYes)) ;
427 } else { 428 } else {
428 temp.reset(this->textureProvider()->createApproxTexture(tempDrawInfo .fTempSurfaceDesc)); 429 temp.reset(this->textureProvider()->createApproxTexture(tempDrawInfo .fTempSurfaceDesc));
429 } 430 }
430 if (temp) { 431 if (temp) {
431 SkMatrix textureMatrix; 432 SkMatrix textureMatrix;
432 textureMatrix.setTranslate(SkIntToScalar(left), SkIntToScalar(top)); 433 textureMatrix.setTranslate(SkIntToScalar(left), SkIntToScalar(top));
433 textureMatrix.postIDiv(src->width(), src->height()); 434 textureMatrix.postIDiv(src->width(), src->height());
434 SkAutoTUnref<const GrFragmentProcessor> fp; 435 SkAutoTUnref<const GrFragmentProcessor> fp;
435 if (unpremul) { 436 if (unpremul) {
436 fp.reset(this->createPMToUPMEffect(src->asTexture(), tempDrawInf o.fSwizzle, 437 fp.reset(this->createPMToUPMEffect(src->asTexture(), tempDrawInf o.fSwizzle,
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
661 ASSERT_SINGLE_OWNER 662 ASSERT_SINGLE_OWNER
662 fResourceCache->setLimits(maxTextures, maxTextureBytes); 663 fResourceCache->setLimits(maxTextures, maxTextureBytes);
663 } 664 }
664 665
665 ////////////////////////////////////////////////////////////////////////////// 666 //////////////////////////////////////////////////////////////////////////////
666 667
667 void GrContext::dumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump) const { 668 void GrContext::dumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump) const {
668 ASSERT_SINGLE_OWNER 669 ASSERT_SINGLE_OWNER
669 fResourceCache->dumpMemoryStatistics(traceMemoryDump); 670 fResourceCache->dumpMemoryStatistics(traceMemoryDump);
670 } 671 }
OLDNEW
« no previous file with comments | « src/effects/SkColorCubeFilter.cpp ('k') | src/gpu/GrGpu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698