blob: a28c27a649616e96b7e9c43fd6044927f05f5658 [file] [log] [blame]
Brian Osman45580d32016-11-23 09:37:01 -05001/*
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"
Brian Osman47299142017-03-07 13:22:22 -05009#include "SkColorSpace_Base.h"
Brian Osman45580d32016-11-23 09:37:01 -050010
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).
18GrSurfaceContext::GrSurfaceContext(GrContext* context,
Robert Phillips72152832017-01-25 17:31:35 -050019 GrDrawingManager* drawingMgr,
Robert Phillips2c862492017-01-18 10:08:39 -050020 sk_sp<SkColorSpace> colorSpace,
Brian Osman45580d32016-11-23 09:37:01 -050021 GrAuditTrail* auditTrail,
22 GrSingleOwner* singleOwner)
23 : fContext(context)
Robert Phillips2c862492017-01-18 10:08:39 -050024 , fColorSpace(std::move(colorSpace))
Brian Osman45580d32016-11-23 09:37:01 -050025 , fAuditTrail(auditTrail)
26#ifdef SK_DEBUG
27 , fSingleOwner(singleOwner)
28#endif
Robert Phillips72152832017-01-25 17:31:35 -050029 , fDrawingManager(drawingMgr) {
Brian Osman45580d32016-11-23 09:37:01 -050030}