Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(249)

Unified Diff: src/gpu/GrGpuObject.cpp

Issue 418143004: Rename GrGpuObject to GrGpuResource (Closed) Base URL: https://skia.googlesource.com/skia.git@compact
Patch Set: Fix indents Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrGpu.cpp ('k') | src/gpu/GrGpuResource.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrGpuObject.cpp
diff --git a/src/gpu/GrGpuObject.cpp b/src/gpu/GrGpuObject.cpp
deleted file mode 100644
index 4a72a50c499689b8ae48f871e58afb68161a45fd..0000000000000000000000000000000000000000
--- a/src/gpu/GrGpuObject.cpp
+++ /dev/null
@@ -1,71 +0,0 @@
-
-/*
- * Copyright 2011 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-
-#include "GrGpuObject.h"
-#include "GrGpu.h"
-
-GrGpuObject::GrGpuObject(GrGpu* gpu, bool isWrapped)
- : fRefCnt(1)
- , fCacheEntry(NULL)
- , fUniqueID(CreateUniqueID()) {
- fGpu = gpu;
- if (isWrapped) {
- fFlags = kWrapped_FlagBit;
- } else {
- fFlags = 0;
- }
- fGpu->insertObject(this);
-}
-
-GrGpuObject::~GrGpuObject() {
- SkASSERT(0 == fRefCnt);
- // subclass should have released this.
- SkASSERT(this->wasDestroyed());
-}
-
-void GrGpuObject::release() {
- if (NULL != fGpu) {
- this->onRelease();
- fGpu->removeObject(this);
- fGpu = NULL;
- }
-}
-
-void GrGpuObject::abandon() {
- if (NULL != fGpu) {
- this->onAbandon();
- fGpu->removeObject(this);
- fGpu = NULL;
- }
-}
-
-const GrContext* GrGpuObject::getContext() const {
- if (NULL != fGpu) {
- return fGpu->getContext();
- } else {
- return NULL;
- }
-}
-
-GrContext* GrGpuObject::getContext() {
- if (NULL != fGpu) {
- return fGpu->getContext();
- } else {
- return NULL;
- }
-}
-
-uint32_t GrGpuObject::CreateUniqueID() {
- static int32_t gUniqueID = SK_InvalidUniqueID;
- uint32_t id;
- do {
- id = static_cast<uint32_t>(sk_atomic_inc(&gUniqueID) + 1);
- } while (id == SK_InvalidUniqueID);
- return id;
-}
« no previous file with comments | « src/gpu/GrGpu.cpp ('k') | src/gpu/GrGpuResource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698