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 1564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1575 } | 1575 } |
1576 if (maxTextureBytes) { | 1576 if (maxTextureBytes) { |
1577 *maxTextureBytes = fResourceCache->getMaxResourceBytes(); | 1577 *maxTextureBytes = fResourceCache->getMaxResourceBytes(); |
1578 } | 1578 } |
1579 } | 1579 } |
1580 | 1580 |
1581 void GrContext::setResourceCacheLimits(int maxTextures, size_t maxTextureBytes)
{ | 1581 void GrContext::setResourceCacheLimits(int maxTextures, size_t maxTextureBytes)
{ |
1582 fResourceCache->setLimits(maxTextures, maxTextureBytes); | 1582 fResourceCache->setLimits(maxTextures, maxTextureBytes); |
1583 } | 1583 } |
1584 | 1584 |
1585 bool GrContext::addResourceToCache(const GrContentKey& key, GrGpuResource* resou
rce) { | 1585 bool GrContext::addResourceToCache(const GrUniqueKey& key, GrGpuResource* resour
ce) { |
1586 ASSERT_OWNED_RESOURCE(resource); | 1586 ASSERT_OWNED_RESOURCE(resource); |
1587 if (!resource || resource->wasDestroyed()) { | 1587 if (!resource || resource->wasDestroyed()) { |
1588 return false; | 1588 return false; |
1589 } | 1589 } |
1590 return resource->resourcePriv().setContentKey(key); | 1590 return resource->resourcePriv().setUniqueKey(key); |
1591 } | 1591 } |
1592 | 1592 |
1593 bool GrContext::isResourceInCache(const GrContentKey& key) const { | 1593 bool GrContext::isResourceInCache(const GrUniqueKey& key) const { |
1594 return fResourceCache->hasContentKey(key); | 1594 return fResourceCache->hasUniqueKey(key); |
1595 } | 1595 } |
1596 | 1596 |
1597 GrGpuResource* GrContext::findAndRefCachedResource(const GrContentKey& key) { | 1597 GrGpuResource* GrContext::findAndRefCachedResource(const GrUniqueKey& key) { |
1598 return fResourceCache->findAndRefContentResource(key); | 1598 return fResourceCache->findAndRefUniqueResource(key); |
1599 } | 1599 } |
1600 | 1600 |
1601 ////////////////////////////////////////////////////////////////////////////// | 1601 ////////////////////////////////////////////////////////////////////////////// |
1602 | 1602 |
1603 void GrContext::addGpuTraceMarker(const GrGpuTraceMarker* marker) { | 1603 void GrContext::addGpuTraceMarker(const GrGpuTraceMarker* marker) { |
1604 fGpu->addGpuTraceMarker(marker); | 1604 fGpu->addGpuTraceMarker(marker); |
1605 if (fDrawBuffer) { | 1605 if (fDrawBuffer) { |
1606 fDrawBuffer->addGpuTraceMarker(marker); | 1606 fDrawBuffer->addGpuTraceMarker(marker); |
1607 } | 1607 } |
1608 } | 1608 } |
1609 | 1609 |
1610 void GrContext::removeGpuTraceMarker(const GrGpuTraceMarker* marker) { | 1610 void GrContext::removeGpuTraceMarker(const GrGpuTraceMarker* marker) { |
1611 fGpu->removeGpuTraceMarker(marker); | 1611 fGpu->removeGpuTraceMarker(marker); |
1612 if (fDrawBuffer) { | 1612 if (fDrawBuffer) { |
1613 fDrawBuffer->removeGpuTraceMarker(marker); | 1613 fDrawBuffer->removeGpuTraceMarker(marker); |
1614 } | 1614 } |
1615 } | 1615 } |
1616 | 1616 |
OLD | NEW |