1 /* 2 * Copyright 2017 Google Inc. 3 * 4 * Use of this source code is governed by a BSD-style license that can be 5 * found in the LICENSE file. 6 */ 7 8 #include "src/gpu/GrOnFlushResourceProvider.h" 9 10 #include "include/gpu/GrDirectContext.h" 11 #include "include/gpu/GrRecordingContext.h" 12 #include "src/gpu/GrDirectContextPriv.h" 13 #include "src/gpu/GrDrawingManager.h" 14 #include "src/gpu/GrProxyProvider.h" 15 #include "src/gpu/GrRecordingContextPriv.h" 16 #include "src/gpu/GrResourceProvider.h" 17 #include "src/gpu/GrSurfaceProxy.h" 18 #include "src/gpu/GrSurfaceProxyPriv.h" 19 #include "src/gpu/GrTextureResolveRenderTask.h" 20 instatiateProxy(GrSurfaceProxy * proxy)21bool GrOnFlushResourceProvider::instatiateProxy(GrSurfaceProxy* proxy) { 22 SkASSERT(proxy->canSkipResourceAllocator()); 23 24 // TODO: this class should probably just get a GrDirectContext 25 auto direct = fDrawingMgr->getContext()->asDirectContext(); 26 if (!direct) { 27 return false; 28 } 29 30 auto resourceProvider = direct->priv().resourceProvider(); 31 32 if (proxy->isLazy()) { 33 return proxy->priv().doLazyInstantiation(resourceProvider); 34 } 35 36 return proxy->instantiate(resourceProvider); 37 } 38 caps() const39const GrCaps* GrOnFlushResourceProvider::caps() const { 40 return fDrawingMgr->getContext()->priv().caps(); 41 } 42