| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |