| 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 "SkGpuDevice.h" | 8 #include "SkGpuDevice.h" |
| 9 | 9 |
| 10 #include "GrBlurUtils.h" | 10 #include "GrBlurUtils.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 #include "SkSurface_Gpu.h" | 39 #include "SkSurface_Gpu.h" |
| 40 #include "SkTLazy.h" | 40 #include "SkTLazy.h" |
| 41 #include "SkUtils.h" | 41 #include "SkUtils.h" |
| 42 #include "SkVertState.h" | 42 #include "SkVertState.h" |
| 43 #include "SkXfermode.h" | 43 #include "SkXfermode.h" |
| 44 #include "batches/GrRectBatchFactory.h" | 44 #include "batches/GrRectBatchFactory.h" |
| 45 #include "effects/GrBicubicEffect.h" | 45 #include "effects/GrBicubicEffect.h" |
| 46 #include "effects/GrDashingEffect.h" | 46 #include "effects/GrDashingEffect.h" |
| 47 #include "effects/GrSimpleTextureEffect.h" | 47 #include "effects/GrSimpleTextureEffect.h" |
| 48 #include "effects/GrTextureDomain.h" | 48 #include "effects/GrTextureDomain.h" |
| 49 #include "text/GrTextContext.h" | 49 #include "text/GrTextUtils.h" |
| 50 | 50 |
| 51 #if SK_SUPPORT_GPU | 51 #if SK_SUPPORT_GPU |
| 52 | 52 |
| 53 #define ASSERT_SINGLE_OWNER \ | 53 #define ASSERT_SINGLE_OWNER \ |
| 54 SkDEBUGCODE(GrSingleOwner::AutoEnforce debug_SingleOwner(fContext->debugSing
leOwner());) | 54 SkDEBUGCODE(GrSingleOwner::AutoEnforce debug_SingleOwner(fContext->debugSing
leOwner());) |
| 55 | 55 |
| 56 enum { kDefaultImageFilterCacheSize = 32 * 1024 * 1024 }; | 56 enum { kDefaultImageFilterCacheSize = 32 * 1024 * 1024 }; |
| 57 | 57 |
| 58 #if 0 | 58 #if 0 |
| 59 extern bool (*gShouldDrawProc)(); | 59 extern bool (*gShouldDrawProc)(); |
| (...skipping 1688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1748 | 1748 |
| 1749 SkDEBUGCODE(this->validate();) | 1749 SkDEBUGCODE(this->validate();) |
| 1750 | 1750 |
| 1751 fDrawContext->drawTextBlob(fClip, paint, *draw.fMatrix, | 1751 fDrawContext->drawTextBlob(fClip, paint, *draw.fMatrix, |
| 1752 blob, x, y, drawFilter, draw.fClip->getBounds()); | 1752 blob, x, y, drawFilter, draw.fClip->getBounds()); |
| 1753 } | 1753 } |
| 1754 | 1754 |
| 1755 /////////////////////////////////////////////////////////////////////////////// | 1755 /////////////////////////////////////////////////////////////////////////////// |
| 1756 | 1756 |
| 1757 bool SkGpuDevice::onShouldDisableLCD(const SkPaint& paint) const { | 1757 bool SkGpuDevice::onShouldDisableLCD(const SkPaint& paint) const { |
| 1758 return GrTextContext::ShouldDisableLCD(paint); | 1758 return GrTextUtils::ShouldDisableLCD(paint); |
| 1759 } | 1759 } |
| 1760 | 1760 |
| 1761 void SkGpuDevice::flush() { | 1761 void SkGpuDevice::flush() { |
| 1762 ASSERT_SINGLE_OWNER | 1762 ASSERT_SINGLE_OWNER |
| 1763 | 1763 |
| 1764 // Clear batch debugging output | 1764 // Clear batch debugging output |
| 1765 // TODO not exactly sure where this should live | 1765 // TODO not exactly sure where this should live |
| 1766 if (GR_BATCH_DEBUGGING_OUTPUT) { | 1766 if (GR_BATCH_DEBUGGING_OUTPUT) { |
| 1767 SkDebugf("%s\n", fContext->getAuditTrail()->toJson().c_str()); | 1767 SkDebugf("%s\n", fContext->getAuditTrail()->toJson().c_str()); |
| 1768 // TODO This currently crashes because not all ops are accounted for | 1768 // TODO This currently crashes because not all ops are accounted for |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1890 } | 1890 } |
| 1891 | 1891 |
| 1892 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { | 1892 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { |
| 1893 ASSERT_SINGLE_OWNER | 1893 ASSERT_SINGLE_OWNER |
| 1894 // We always return a transient cache, so it is freed after each | 1894 // We always return a transient cache, so it is freed after each |
| 1895 // filter traversal. | 1895 // filter traversal. |
| 1896 return SkGpuDevice::NewImageFilterCache(); | 1896 return SkGpuDevice::NewImageFilterCache(); |
| 1897 } | 1897 } |
| 1898 | 1898 |
| 1899 #endif | 1899 #endif |
| OLD | NEW |