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 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 SkAutoTUnref<GrTexture> tempTexture; | 279 SkAutoTUnref<GrTexture> tempTexture; |
280 if (GrGpu::kNoDraw_DrawPreference != drawPreference) { | 280 if (GrGpu::kNoDraw_DrawPreference != drawPreference) { |
281 tempTexture.reset( | 281 tempTexture.reset( |
282 this->textureProvider()->createApproxTexture(tempDrawInfo.fTempSurfa
ceDesc)); | 282 this->textureProvider()->createApproxTexture(tempDrawInfo.fTempSurfa
ceDesc)); |
283 if (!tempTexture && GrGpu::kRequireDraw_DrawPreference == drawPreference
) { | 283 if (!tempTexture && GrGpu::kRequireDraw_DrawPreference == drawPreference
) { |
284 return false; | 284 return false; |
285 } | 285 } |
286 } | 286 } |
287 | 287 |
288 // temp buffer for doing sw premul conversion, if needed. | 288 // temp buffer for doing sw premul conversion, if needed. |
| 289 #if defined(GOOGLE3) |
| 290 // Stack frame size is limited in GOOGLE3. |
| 291 SkAutoSTMalloc<48 * 48, uint32_t> tmpPixels(0); |
| 292 #else |
289 SkAutoSTMalloc<128 * 128, uint32_t> tmpPixels(0); | 293 SkAutoSTMalloc<128 * 128, uint32_t> tmpPixels(0); |
| 294 #endif |
290 if (tempTexture) { | 295 if (tempTexture) { |
291 SkAutoTUnref<const GrFragmentProcessor> fp; | 296 SkAutoTUnref<const GrFragmentProcessor> fp; |
292 SkMatrix textureMatrix; | 297 SkMatrix textureMatrix; |
293 textureMatrix.setIDiv(tempTexture->width(), tempTexture->height()); | 298 textureMatrix.setIDiv(tempTexture->width(), tempTexture->height()); |
294 if (applyPremulToSrc) { | 299 if (applyPremulToSrc) { |
295 fp.reset(this->createUPMToPMEffect(tempTexture, tempDrawInfo.fSwizzl
e, | 300 fp.reset(this->createUPMToPMEffect(tempTexture, tempDrawInfo.fSwizzl
e, |
296 textureMatrix)); | 301 textureMatrix)); |
297 // If premultiplying was the only reason for the draw, fall back to
a straight write. | 302 // If premultiplying was the only reason for the draw, fall back to
a straight write. |
298 if (!fp) { | 303 if (!fp) { |
299 if (GrGpu::kCallerPrefersDraw_DrawPreference == drawPreference)
{ | 304 if (GrGpu::kCallerPrefersDraw_DrawPreference == drawPreference)
{ |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
652 ASSERT_SINGLE_OWNER | 657 ASSERT_SINGLE_OWNER |
653 fResourceCache->setLimits(maxTextures, maxTextureBytes); | 658 fResourceCache->setLimits(maxTextures, maxTextureBytes); |
654 } | 659 } |
655 | 660 |
656 ////////////////////////////////////////////////////////////////////////////// | 661 ////////////////////////////////////////////////////////////////////////////// |
657 | 662 |
658 void GrContext::dumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump) const { | 663 void GrContext::dumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump) const { |
659 ASSERT_SINGLE_OWNER | 664 ASSERT_SINGLE_OWNER |
660 fResourceCache->dumpMemoryStatistics(traceMemoryDump); | 665 fResourceCache->dumpMemoryStatistics(traceMemoryDump); |
661 } | 666 } |
OLD | NEW |