| OLD | NEW |
| 1 | |
| 2 /* | 1 /* |
| 3 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
| 4 * | 3 * |
| 5 * 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 |
| 6 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 7 */ | 6 */ |
| 8 | 7 |
| 9 #include "GrContext.h" | 8 #include "GrContext.h" |
| 10 #include "GrContextOptions.h" | 9 #include "GrContextOptions.h" |
| 11 #include "GrDrawingManager.h" | 10 #include "GrDrawingManager.h" |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 } | 260 } |
| 262 | 261 |
| 263 GrGpu::DrawPreference drawPreference = GrGpu::kNoDraw_DrawPreference; | 262 GrGpu::DrawPreference drawPreference = GrGpu::kNoDraw_DrawPreference; |
| 264 // 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 |
| 265 // 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. |
| 266 if (applyPremulToSrc && !this->didFailPMUPMConversionTest()) { | 265 if (applyPremulToSrc && !this->didFailPMUPMConversionTest()) { |
| 267 drawPreference = GrGpu::kCallerPrefersDraw_DrawPreference; | 266 drawPreference = GrGpu::kCallerPrefersDraw_DrawPreference; |
| 268 } | 267 } |
| 269 | 268 |
| 270 GrGpu::WritePixelTempDrawInfo tempDrawInfo; | 269 GrGpu::WritePixelTempDrawInfo tempDrawInfo; |
| 271 if (!fGpu->getWritePixelsInfo(surface, width, height, rowBytes, srcConfig, &
drawPreference, | 270 if (!fGpu->getWritePixelsInfo(surface, width, height, srcConfig, &drawPrefer
ence, |
| 272 &tempDrawInfo)) { | 271 &tempDrawInfo)) { |
| 273 return false; | 272 return false; |
| 274 } | 273 } |
| 275 | 274 |
| 276 if (!(kDontFlush_PixelOpsFlag & pixelOpsFlags) && surface->surfacePriv().has
PendingIO()) { | 275 if (!(kDontFlush_PixelOpsFlag & pixelOpsFlags) && surface->surfacePriv().has
PendingIO()) { |
| 277 this->flush(); | 276 this->flush(); |
| 278 } | 277 } |
| 279 | 278 |
| 280 SkAutoTUnref<GrTexture> tempTexture; | 279 SkAutoTUnref<GrTexture> tempTexture; |
| 281 if (GrGpu::kNoDraw_DrawPreference != drawPreference) { | 280 if (GrGpu::kNoDraw_DrawPreference != drawPreference) { |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 661 ASSERT_SINGLE_OWNER | 660 ASSERT_SINGLE_OWNER |
| 662 fResourceCache->setLimits(maxTextures, maxTextureBytes); | 661 fResourceCache->setLimits(maxTextures, maxTextureBytes); |
| 663 } | 662 } |
| 664 | 663 |
| 665 ////////////////////////////////////////////////////////////////////////////// | 664 ////////////////////////////////////////////////////////////////////////////// |
| 666 | 665 |
| 667 void GrContext::dumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump) const { | 666 void GrContext::dumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump) const { |
| 668 ASSERT_SINGLE_OWNER | 667 ASSERT_SINGLE_OWNER |
| 669 fResourceCache->dumpMemoryStatistics(traceMemoryDump); | 668 fResourceCache->dumpMemoryStatistics(traceMemoryDump); |
| 670 } | 669 } |
| OLD | NEW |