LCOV - code coverage report
Current view: top level - gfx/skia/skia/src/gpu - GrPreFlushResourceProvider.cpp (source / functions) Hit Total Coverage
Test: output.info Lines: 0 35 0.0 %
Date: 2017-07-14 16:53:18 Functions: 0 2 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       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 "GrPreFlushResourceProvider.h"
       9             : 
      10             : #include "GrDrawingManager.h"
      11             : #include "GrSurfaceProxy.h"
      12             : 
      13           0 : sk_sp<GrRenderTargetContext> GrPreFlushResourceProvider::makeRenderTargetContext(
      14             :                                                         const GrSurfaceDesc& desc,
      15             :                                                         sk_sp<SkColorSpace> colorSpace,
      16             :                                                         const SkSurfaceProps* props) {
      17           0 :     GrSurfaceDesc tmpDesc = desc;
      18           0 :     tmpDesc.fFlags |= kRenderTarget_GrSurfaceFlag;
      19             : 
      20             :     // Because this is being allocated at the start of a flush we must ensure the proxy
      21             :     // will, when instantiated, have no pending IO.
      22             :     // TODO: fold the kNoPendingIO_Flag into GrSurfaceFlags?
      23           0 :     sk_sp<GrSurfaceProxy> proxy = GrSurfaceProxy::MakeDeferred(
      24           0 :                                                     fDrawingMgr->getContext()->resourceProvider(),
      25             :                                                     tmpDesc,
      26             :                                                     SkBackingFit::kExact,
      27             :                                                     SkBudgeted::kYes,
      28           0 :                                                     GrResourceProvider::kNoPendingIO_Flag);
      29           0 :     if (!proxy->asRenderTargetProxy()) {
      30           0 :         return nullptr;
      31             :     }
      32             : 
      33             :     sk_sp<GrRenderTargetOpList> opList(new GrRenderTargetOpList(
      34           0 :                                                     proxy->asRenderTargetProxy(),
      35           0 :                                                     fDrawingMgr->fContext->getGpu(),
      36           0 :                                                     fDrawingMgr->fContext->resourceProvider(),
      37           0 :                                                     fDrawingMgr->fContext->getAuditTrail(),
      38           0 :                                                     fDrawingMgr->fOptionsForOpLists));
      39           0 :     proxy->setLastOpList(opList.get());
      40             : 
      41             :     sk_sp<GrRenderTargetContext> renderTargetContext(
      42           0 :         fDrawingMgr->makeRenderTargetContext(std::move(proxy),
      43           0 :                                              std::move(colorSpace),
      44           0 :                                              props));
      45             : 
      46           0 :     if (!renderTargetContext) {
      47           0 :         return nullptr;
      48             :     }
      49             : 
      50           0 :     renderTargetContext->discard();
      51             : 
      52           0 :     return renderTargetContext;
      53             : }
      54             : 
      55             : // TODO: we only need this entry point as long as we have to pre-allocate the atlas.
      56             : // Remove it ASAP.
      57           0 : sk_sp<GrRenderTargetContext> GrPreFlushResourceProvider::makeRenderTargetContext(
      58             :                                                         sk_sp<GrSurfaceProxy> proxy,
      59             :                                                         sk_sp<SkColorSpace> colorSpace,
      60             :                                                         const SkSurfaceProps* props) {
      61             : 
      62             :     sk_sp<GrRenderTargetOpList> opList(new GrRenderTargetOpList(
      63           0 :                                                     proxy->asRenderTargetProxy(),
      64           0 :                                                     fDrawingMgr->fContext->getGpu(),
      65           0 :                                                     fDrawingMgr->fContext->resourceProvider(),
      66           0 :                                                     fDrawingMgr->fContext->getAuditTrail(),
      67           0 :                                                     fDrawingMgr->fOptionsForOpLists));
      68           0 :     proxy->setLastOpList(opList.get());
      69             : 
      70             :     sk_sp<GrRenderTargetContext> renderTargetContext(
      71           0 :         fDrawingMgr->makeRenderTargetContext(std::move(proxy),
      72           0 :                                              std::move(colorSpace),
      73           0 :                                              props));
      74             : 
      75           0 :     if (!renderTargetContext) {
      76           0 :         return nullptr;
      77             :     }
      78             : 
      79           0 :     renderTargetContext->discard();
      80             : 
      81           0 :     return renderTargetContext;
      82             : }
      83             : 

Generated by: LCOV version 1.13