| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 #include "GrContext.h" | 9 #include "GrContext.h" |
| 10 | 10 |
| (...skipping 1519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1530 srcPI.fRowBytes = rowBytes; | 1530 srcPI.fRowBytes = rowBytes; |
| 1531 | 1531 |
| 1532 return srcPI.convertPixelsTo(&dstPI, width, height); | 1532 return srcPI.convertPixelsTo(&dstPI, width, height); |
| 1533 } | 1533 } |
| 1534 return true; | 1534 return true; |
| 1535 } | 1535 } |
| 1536 | 1536 |
| 1537 void GrContext::resolveRenderTarget(GrRenderTarget* target) { | 1537 void GrContext::resolveRenderTarget(GrRenderTarget* target) { |
| 1538 SkASSERT(target); | 1538 SkASSERT(target); |
| 1539 ASSERT_OWNED_RESOURCE(target); | 1539 ASSERT_OWNED_RESOURCE(target); |
| 1540 if (!target->needsResolve()) { | 1540 this->flush(); |
| 1541 return; | |
| 1542 } | |
| 1543 if (target->surfacePriv().hasPendingIO()) { | |
| 1544 this->flush(); | |
| 1545 } | |
| 1546 if (fGpu) { | 1541 if (fGpu) { |
| 1547 fGpu->resolveRenderTarget(target); | 1542 fGpu->resolveRenderTarget(target); |
| 1548 } | 1543 } |
| 1549 } | 1544 } |
| 1550 | 1545 |
| 1551 void GrContext::discardRenderTarget(GrRenderTarget* renderTarget) { | 1546 void GrContext::discardRenderTarget(GrRenderTarget* renderTarget) { |
| 1552 SkASSERT(renderTarget); | 1547 SkASSERT(renderTarget); |
| 1553 ASSERT_OWNED_RESOURCE(renderTarget); | 1548 ASSERT_OWNED_RESOURCE(renderTarget); |
| 1554 AutoRestoreEffects are; | 1549 AutoRestoreEffects are; |
| 1555 AutoCheckFlush acf(this); | 1550 AutoCheckFlush acf(this); |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1784 fResourceCache->printStats(); | 1779 fResourceCache->printStats(); |
| 1785 } | 1780 } |
| 1786 #endif | 1781 #endif |
| 1787 | 1782 |
| 1788 #if GR_GPU_STATS | 1783 #if GR_GPU_STATS |
| 1789 const GrContext::GPUStats* GrContext::gpuStats() const { | 1784 const GrContext::GPUStats* GrContext::gpuStats() const { |
| 1790 return fGpu->gpuStats(); | 1785 return fGpu->gpuStats(); |
| 1791 } | 1786 } |
| 1792 #endif | 1787 #endif |
| 1793 | 1788 |
| OLD | NEW |