3 * Copyright 2011 Google Inc.
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
10 #include "GrGpuObject.h"
13 GrGpuObject::GrGpuObject(GrGpu* gpu, bool isWrapped) {
15 fDeferredRefCount = 0;
17 fFlags = kWrapped_FlagBit;
21 fGpu->insertObject(this);
24 GrGpuObject::~GrGpuObject() {
25 // subclass should have released this.
26 SkASSERT(0 == fDeferredRefCount);
27 SkASSERT(this->wasDestroyed());
30 void GrGpuObject::release() {
33 fGpu->removeObject(this);
38 void GrGpuObject::abandon() {
41 fGpu->removeObject(this);
46 const GrContext* GrGpuObject::getContext() const {
48 return fGpu->getContext();
54 GrContext* GrGpuObject::getContext() {
56 return fGpu->getContext();