| 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 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 } | 260 } |
| 261 | 261 |
| 262 GrGpu::DrawPreference drawPreference = GrGpu::kNoDraw_DrawPreference; | 262 GrGpu::DrawPreference drawPreference = GrGpu::kNoDraw_DrawPreference; |
| 263 // Don't prefer to draw for the conversion (and thereby access a texture fro
m the cache) when | 263 // Don't prefer to draw for the conversion (and thereby access a texture fro
m the cache) when |
| 264 // we've already determined that there isn't a roundtrip preserving conversi
on processor pair. | 264 // we've already determined that there isn't a roundtrip preserving conversi
on processor pair. |
| 265 if (applyPremulToSrc && !this->didFailPMUPMConversionTest()) { | 265 if (applyPremulToSrc && !this->didFailPMUPMConversionTest()) { |
| 266 drawPreference = GrGpu::kCallerPrefersDraw_DrawPreference; | 266 drawPreference = GrGpu::kCallerPrefersDraw_DrawPreference; |
| 267 } | 267 } |
| 268 | 268 |
| 269 GrGpu::WritePixelTempDrawInfo tempDrawInfo; | 269 GrGpu::WritePixelTempDrawInfo tempDrawInfo; |
| 270 if (!fGpu->getWritePixelsInfo(surface, width, height, rowBytes, srcConfig, &
drawPreference, | 270 if (!fGpu->getWritePixelsInfo(surface, width, height, srcConfig, &drawPrefer
ence, |
| 271 &tempDrawInfo)) { | 271 &tempDrawInfo)) { |
| 272 return false; | 272 return false; |
| 273 } | 273 } |
| 274 | 274 |
| 275 if (!(kDontFlush_PixelOpsFlag & pixelOpsFlags) && surface->surfacePriv().has
PendingIO()) { | 275 if (!(kDontFlush_PixelOpsFlag & pixelOpsFlags) && surface->surfacePriv().has
PendingIO()) { |
| 276 this->flush(); | 276 this->flush(); |
| 277 } | 277 } |
| 278 | 278 |
| 279 SkAutoTUnref<GrTexture> tempTexture; | 279 SkAutoTUnref<GrTexture> tempTexture; |
| 280 if (GrGpu::kNoDraw_DrawPreference != drawPreference) { | 280 if (GrGpu::kNoDraw_DrawPreference != drawPreference) { |
| (...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 652 ASSERT_SINGLE_OWNER | 652 ASSERT_SINGLE_OWNER |
| 653 fResourceCache->setLimits(maxTextures, maxTextureBytes); | 653 fResourceCache->setLimits(maxTextures, maxTextureBytes); |
| 654 } | 654 } |
| 655 | 655 |
| 656 ////////////////////////////////////////////////////////////////////////////// | 656 ////////////////////////////////////////////////////////////////////////////// |
| 657 | 657 |
| 658 void GrContext::dumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump) const { | 658 void GrContext::dumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump) const { |
| 659 ASSERT_SINGLE_OWNER | 659 ASSERT_SINGLE_OWNER |
| 660 fResourceCache->dumpMemoryStatistics(traceMemoryDump); | 660 fResourceCache->dumpMemoryStatistics(traceMemoryDump); |
| 661 } | 661 } |
| OLD | NEW |