• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2016 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 "GrSurfaceContext.h"
9 #include "SkColorSpace_Base.h"
10 
11 #include "../private/GrAuditTrail.h"
12 
13 
14 // In MDB mode the reffing of the 'getLastOpList' call's result allows in-progress
15 // GrOpLists to be picked up and added to by renderTargetContexts lower in the call
16 // stack. When this occurs with a closed GrOpList, a new one will be allocated
17 // when the renderTargetContext attempts to use it (via getOpList).
GrSurfaceContext(GrContext * context,GrDrawingManager * drawingMgr,sk_sp<SkColorSpace> colorSpace,GrAuditTrail * auditTrail,GrSingleOwner * singleOwner)18 GrSurfaceContext::GrSurfaceContext(GrContext* context,
19                                    GrDrawingManager* drawingMgr,
20                                    sk_sp<SkColorSpace> colorSpace,
21                                    GrAuditTrail* auditTrail,
22                                    GrSingleOwner* singleOwner)
23     : fContext(context)
24     , fColorSpace(std::move(colorSpace))
25     , fAuditTrail(auditTrail)
26 #ifdef SK_DEBUG
27     , fSingleOwner(singleOwner)
28 #endif
29     , fDrawingManager(drawingMgr) {
30 }
31