Lines Matching defs:proxy
71 // In DDL-mode a proxy provider can still have extant uniquely keyed proxies (since
78 bool GrProxyProvider::assignUniqueKeyToProxy(const GrUniqueKey& key, GrTextureProxy* proxy) {
81 if (this->isAbandoned() || !proxy) {
92 proxy->cacheAccess().setUniqueKey(this, key);
93 SkASSERT(proxy->getUniqueKey() == key);
94 fUniquelyKeyedProxies.add(proxy);
98 void GrProxyProvider::adoptUniqueKeyFromSurface(GrTextureProxy* proxy, const GrSurface* surf) {
100 proxy->cacheAccess().setUniqueKey(this, surf->getUniqueKey());
101 SkASSERT(proxy->getUniqueKey() == surf->getUniqueKey());
104 fUniquelyKeyedProxies.add(proxy);
107 void GrProxyProvider::removeUniqueKeyFromProxy(GrTextureProxy* proxy) {
109 SkASSERT(proxy);
110 SkASSERT(proxy->getUniqueKey().isValid());
116 this->processInvalidUniqueKey(proxy->getUniqueKey(), proxy, InvalidateGPUResource::kYes);
236 sk_sp<GrTextureProxy> proxy = this->createLazyProxy(
239 // Nothing to clean up here. Once the proxy (and thus lambda) is deleted the ref
256 if (!proxy) {
261 // In order to reuse code we always create a lazy proxy. When we aren't in DDL mode however
262 // we're better off instantiating the proxy immediately here.
263 if (!proxy->priv().doLazyInstantiation(fResourceProvider)) {
268 SkASSERT(proxy->width() == desc.fWidth);
269 SkASSERT(proxy->height() == desc.fHeight);
270 return proxy;
334 sk_sp<GrTextureProxy> proxy = this->createLazyProxy(
365 if (!proxy) {
370 // In order to reuse code we always create a lazy proxy. When we aren't in DDL mode however
371 // we're better off instantiating the proxy immediately here.
372 if (!proxy->priv().doLazyInstantiation(fResourceProvider)) {
376 return proxy;
423 sk_sp<GrTextureProxy> proxy = this->createLazyProxy(
437 if (!proxy) {
442 // In order to reuse code we always create a lazy proxy. When we aren't in DDL mode however
443 // we're better off instantiating the proxy immediately here.
444 if (!proxy->priv().doLazyInstantiation(fResourceProvider)) {
448 return proxy;
482 // Make sure we match how we created the proxy with SkBudgeted::kNo
512 // Make sure we match how we created the proxy with SkBudgeted::kNo
535 // Make sure we match how we created the proxy with SkBudgeted::kNo
559 // This proxy should be unbudgeted because we're just wrapping an external resource
584 // This proxy should be unbudgeted because we're just wrapping an external resource
613 // For non-ddl draws always make lazy proxy's single use.
673 // For non-ddl draws always make lazy proxy's single use.
714 bool GrProxyProvider::IsFunctionallyExact(GrSurfaceProxy* proxy) {
715 const bool isInstantiated = proxy->isInstantiated();
716 // A proxy is functionally exact if:
719 // it is already instantiated and the proxy covers the entire backing surface
720 return proxy->priv().isExact() ||
721 (!isInstantiated && SkIsPow2(proxy->width()) && SkIsPow2(proxy->height())) ||
722 (isInstantiated && proxy->worstCaseWidth() == proxy->width() &&
723 proxy->worstCaseHeight() == proxy->height());
726 void GrProxyProvider::processInvalidUniqueKey(const GrUniqueKey& key, GrTextureProxy* proxy,
730 if (!proxy) {
731 proxy = fUniquelyKeyedProxies.find(key);
733 SkASSERT(!proxy || proxy->getUniqueKey() == key);
736 // proxy's unique key. We must do it in this order because 'key' may alias the proxy's key.
739 if (proxy && proxy->isInstantiated()) {
740 invalidGpuResource = sk_ref_sp(proxy->peekSurface());
750 if (proxy) {
752 proxy->cacheAccess().clearUniqueKey();