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 "GrContextPriv.h" | 9 #include "GrContextPriv.h" |
10 #include "GrContextOptions.h" | 10 #include "GrContextOptions.h" |
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
511 return srcPI.convertPixelsTo(&dstPI, width, height); | 511 return srcPI.convertPixelsTo(&dstPI, width, height); |
512 } | 512 } |
513 return true; | 513 return true; |
514 } | 514 } |
515 | 515 |
516 void GrContext::prepareSurfaceForExternalIO(GrSurface* surface) { | 516 void GrContext::prepareSurfaceForExternalIO(GrSurface* surface) { |
517 ASSERT_SINGLE_OWNER | 517 ASSERT_SINGLE_OWNER |
518 RETURN_IF_ABANDONED | 518 RETURN_IF_ABANDONED |
519 SkASSERT(surface); | 519 SkASSERT(surface); |
520 ASSERT_OWNED_RESOURCE(surface); | 520 ASSERT_OWNED_RESOURCE(surface); |
521 if (surface->surfacePriv().hasPendingIO()) { | 521 fDrawingManager->prepareSurfaceForExternalIO(surface); |
522 this->flush(); | |
523 } | |
524 GrRenderTarget* rt = surface->asRenderTarget(); | |
525 if (fGpu && rt) { | |
526 fGpu->resolveRenderTarget(rt); | |
527 } | |
528 } | 522 } |
529 | 523 |
530 bool GrContext::copySurface(GrSurface* dst, GrSurface* src, const SkIRect& srcRe
ct, | 524 bool GrContext::copySurface(GrSurface* dst, GrSurface* src, const SkIRect& srcRe
ct, |
531 const SkIPoint& dstPoint) { | 525 const SkIPoint& dstPoint) { |
532 ASSERT_SINGLE_OWNER | 526 ASSERT_SINGLE_OWNER |
533 RETURN_FALSE_IF_ABANDONED | 527 RETURN_FALSE_IF_ABANDONED |
534 GR_AUDIT_TRAIL_AUTO_FRAME(&fAuditTrail, "GrContext::copySurface"); | 528 GR_AUDIT_TRAIL_AUTO_FRAME(&fAuditTrail, "GrContext::copySurface"); |
535 | 529 |
536 if (!src || !dst) { | 530 if (!src || !dst) { |
537 return false; | 531 return false; |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
836 ASSERT_SINGLE_OWNER | 830 ASSERT_SINGLE_OWNER |
837 fResourceCache->setLimits(maxTextures, maxTextureBytes); | 831 fResourceCache->setLimits(maxTextures, maxTextureBytes); |
838 } | 832 } |
839 | 833 |
840 ////////////////////////////////////////////////////////////////////////////// | 834 ////////////////////////////////////////////////////////////////////////////// |
841 | 835 |
842 void GrContext::dumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump) const { | 836 void GrContext::dumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump) const { |
843 ASSERT_SINGLE_OWNER | 837 ASSERT_SINGLE_OWNER |
844 fResourceCache->dumpMemoryStatistics(traceMemoryDump); | 838 fResourceCache->dumpMemoryStatistics(traceMemoryDump); |
845 } | 839 } |
OLD | NEW |