Rename GrGpuObject to GrGpuResource
R=robertphillips@google.com
Author: bsalomon@google.com
Review URL: https://codereview.chromium.org/418143004
diff --git a/bench/GrResourceCacheBench.cpp b/bench/GrResourceCacheBench.cpp
index b8eacd6..84e0e5d 100644
--- a/bench/GrResourceCacheBench.cpp
+++ b/bench/GrResourceCacheBench.cpp
@@ -9,7 +9,7 @@
#if SK_SUPPORT_GPU
#include "Benchmark.h"
-#include "GrGpuObject.h"
+#include "GrGpuResource.h"
#include "GrContext.h"
#include "GrResourceCache.h"
#include "GrStencilBuffer.h"
@@ -21,7 +21,7 @@
CACHE_SIZE_BYTES = 2 * 1024 * 1024,
};
-class StencilResource : public GrGpuObject {
+class StencilResource : public GrGpuResource {
public:
SK_DECLARE_INST_COUNT(StencilResource);
StencilResource(GrGpu* gpu, int id)
@@ -42,10 +42,10 @@
int fID;
private:
- typedef GrGpuObject INHERITED;
+ typedef GrGpuResource INHERITED;
};
-class TextureResource : public GrGpuObject {
+class TextureResource : public GrGpuResource {
public:
SK_DECLARE_INST_COUNT(TextureResource);
TextureResource(GrGpu* gpu, int id)
@@ -66,7 +66,7 @@
int fID;
private:
- typedef GrGpuObject INHERITED;
+ typedef GrGpuResource INHERITED;
};
static void get_stencil(int i, int* w, int* h, int* s) {
@@ -89,7 +89,7 @@
int w, h, s;
get_stencil(i, &w, &h, &s);
GrResourceKey key = GrStencilBuffer::ComputeKey(w, h, s);
- GrGpuObject* resource = SkNEW_ARGS(StencilResource, (gpu, i));
+ GrGpuResource* resource = SkNEW_ARGS(StencilResource, (gpu, i));
cache->purgeAsNeeded(1, resource->gpuMemorySize());
cache->addResource(key, resource);
resource->unref();
@@ -99,7 +99,7 @@
GrTextureDesc desc;
get_texture_desc(i, &desc);
GrResourceKey key = TextureResource::ComputeKey(desc);
- GrGpuObject* resource = SkNEW_ARGS(TextureResource, (gpu, i));
+ GrGpuResource* resource = SkNEW_ARGS(TextureResource, (gpu, i));
cache->purgeAsNeeded(1, resource->gpuMemorySize());
cache->addResource(key, resource);
resource->unref();
@@ -112,7 +112,7 @@
GrTextureDesc desc;
get_texture_desc(k, &desc);
GrResourceKey key = TextureResource::ComputeKey(desc);
- GrGpuObject* item = cache->find(key);
+ GrGpuResource* item = cache->find(key);
if (NULL == item) {
SkFAIL("cache add does not work as expected");
return;
@@ -126,7 +126,7 @@
int w, h, s;
get_stencil(k, &w, &h, &s);
GrResourceKey key = StencilResource::ComputeKey(w, h, s);
- GrGpuObject* item = cache->find(key);
+ GrGpuResource* item = cache->find(key);
if (NULL == item) {
SkFAIL("cache add does not work as expected");
return;
@@ -143,7 +143,7 @@
get_texture_desc(k, &desc);
desc.fHeight |= 1;
GrResourceKey key = TextureResource::ComputeKey(desc);
- GrGpuObject* item = cache->find(key);
+ GrGpuResource* item = cache->find(key);
if (NULL != item) {
SkFAIL("cache add does not work as expected");
return;
@@ -154,7 +154,7 @@
get_stencil(k, &w, &h, &s);
h |= 1;
GrResourceKey key = StencilResource::ComputeKey(w, h, s);
- GrGpuObject* item = cache->find(key);
+ GrGpuResource* item = cache->find(key);
if (NULL != item) {
SkFAIL("cache add does not work as expected");
return;
diff --git a/gyp/gpu.gypi b/gyp/gpu.gypi
index 64829cc..85422ca 100644
--- a/gyp/gpu.gypi
+++ b/gyp/gpu.gypi
@@ -20,7 +20,7 @@
'<(skia_include_path)/gpu/GrEffectUnitTest.h',
'<(skia_include_path)/gpu/GrFontScaler.h',
'<(skia_include_path)/gpu/GrGlyph.h',
- '<(skia_include_path)/gpu/GrGpuObject.h',
+ '<(skia_include_path)/gpu/GrGpuResource.h',
'<(skia_include_path)/gpu/GrPaint.h',
'<(skia_include_path)/gpu/GrPathRendererChain.h',
'<(skia_include_path)/gpu/GrRect.h',
@@ -77,7 +77,7 @@
'<(skia_src_path)/gpu/GrGeometryBuffer.h',
'<(skia_src_path)/gpu/GrGpu.cpp',
'<(skia_src_path)/gpu/GrGpu.h',
- '<(skia_src_path)/gpu/GrGpuObject.cpp',
+ '<(skia_src_path)/gpu/GrGpuResource.cpp',
'<(skia_src_path)/gpu/GrGpuFactory.cpp',
'<(skia_src_path)/gpu/GrIndexBuffer.h',
'<(skia_src_path)/gpu/GrInOrderDrawBuffer.cpp',
diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h
index a379f80..f533851 100644
--- a/include/gpu/GrContext.h
+++ b/include/gpu/GrContext.h
@@ -90,9 +90,9 @@
* buffer, etc. references/IDs are now invalid. Should be called even when
* GrContext is no longer going to be used for two reasons:
* 1) ~GrContext will not try to free the objects in the 3D API.
- * 2) If you've created GrGpuObjects that outlive the GrContext they will
- * be marked as invalid (GrGpuObjects::isValid()) and won't attempt to
- * free their underlying resource in the 3D API.
+ * 2) If you've created GrGpuResources that outlive the GrContext they
+ * will be marked as invalid (GrGpuResource::isValid()) and won't
+ * attempt to free their underlying resource in the 3D API.
* Content drawn since the last GrContext::flush() may be lost.
*/
void contextLost();
@@ -185,14 +185,14 @@
/**
* Stores a custom resource in the cache, based on the specified key.
*/
- void addResourceToCache(const GrResourceKey&, GrGpuObject*);
+ void addResourceToCache(const GrResourceKey&, GrGpuResource*);
/**
* Finds a resource in the cache, based on the specified key. This is intended for use in
* conjunction with addResourceToCache(). The return value will be NULL if not found. The
* caller must balance with a call to unref().
*/
- GrGpuObject* findAndRefCachedResource(const GrResourceKey&);
+ GrGpuResource* findAndRefCachedResource(const GrResourceKey&);
/**
* Creates a new text rendering context that is optimal for the
diff --git a/include/gpu/GrGpuObject.h b/include/gpu/GrGpuResource.h
similarity index 93%
rename from include/gpu/GrGpuObject.h
rename to include/gpu/GrGpuResource.h
index 51cac1c..127f64b 100644
--- a/include/gpu/GrGpuObject.h
+++ b/include/gpu/GrGpuResource.h
@@ -5,8 +5,8 @@
* found in the LICENSE file.
*/
-#ifndef GrGpuObject_DEFINED
-#define GrGpuObject_DEFINED
+#ifndef GrGpuResource_DEFINED
+#define GrGpuResource_DEFINED
#include "SkInstCnt.h"
#include "SkTInternalLList.h"
@@ -18,9 +18,9 @@
/**
* Base class for objects that can be kept in the GrResourceCache.
*/
-class GrGpuObject : public SkNoncopyable {
+class GrGpuResource : public SkNoncopyable {
public:
- SK_DECLARE_INST_COUNT_ROOT(GrGpuObject)
+ SK_DECLARE_INST_COUNT_ROOT(GrGpuResource)
// These method signatures are written to mirror SkRefCnt. However, we don't require
// thread safety as GrCacheable objects are not intended to cross thread boundaries.
@@ -89,8 +89,8 @@
uint32_t getUniqueID() const { return fUniqueID; }
protected:
- GrGpuObject(GrGpu*, bool isWrapped);
- virtual ~GrGpuObject();
+ GrGpuResource(GrGpu*, bool isWrapped);
+ virtual ~GrGpuResource();
bool isInCache() const { return NULL != fCacheEntry; }
@@ -119,10 +119,10 @@
static uint32_t CreateUniqueID();
// We're in an internal doubly linked list
- SK_DECLARE_INTERNAL_LLIST_INTERFACE(GrGpuObject);
+ SK_DECLARE_INTERNAL_LLIST_INTERFACE(GrGpuResource);
GrGpu* fGpu; // not reffed. The GrGpu can be deleted while there
- // are still live GrGpuObjects. It will call
+ // are still live GrGpuResources. It will call
// release() on all such objects in its destructor.
enum Flags {
/**
diff --git a/include/gpu/GrSurface.h b/include/gpu/GrSurface.h
index a851c9e..6087ef4 100644
--- a/include/gpu/GrSurface.h
+++ b/include/gpu/GrSurface.h
@@ -10,14 +10,14 @@
#define GrSurface_DEFINED
#include "GrTypes.h"
-#include "GrGpuObject.h"
+#include "GrGpuResource.h"
#include "SkRect.h"
class GrTexture;
class GrRenderTarget;
struct SkImageInfo;
-class GrSurface : public GrGpuObject {
+class GrSurface : public GrGpuResource {
public:
SK_DECLARE_INST_COUNT(GrSurface);
@@ -144,7 +144,7 @@
GrTextureDesc fDesc;
private:
- typedef GrGpuObject INHERITED;
+ typedef GrGpuResource INHERITED;
};
#endif // GrSurface_DEFINED
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index d3edd21..c171446 100755
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -257,7 +257,7 @@
const GrCacheID& cacheID,
const GrTextureParams* params) {
GrResourceKey resourceKey = GrTextureImpl::ComputeKey(fGpu, params, desc, cacheID);
- GrGpuObject* resource = fResourceCache->find(resourceKey);
+ GrGpuResource* resource = fResourceCache->find(resourceKey);
SkSafeRef(resource);
return static_cast<GrTexture*>(resource);
}
@@ -283,7 +283,7 @@
GrResourceKey resourceKey = GrStencilBuffer::ComputeKey(width,
height,
sampleCnt);
- GrGpuObject* resource = fResourceCache->find(resourceKey);
+ GrGpuResource* resource = fResourceCache->find(resourceKey);
return static_cast<GrStencilBuffer*>(resource);
}
@@ -471,7 +471,7 @@
desc.fHeight = SkTMax(MIN_SIZE, GrNextPow2(desc.fHeight));
}
- GrGpuObject* resource = NULL;
+ GrGpuResource* resource = NULL;
int origWidth = desc.fWidth;
int origHeight = desc.fHeight;
@@ -1903,13 +1903,13 @@
return path;
}
-void GrContext::addResourceToCache(const GrResourceKey& resourceKey, GrGpuObject* resource) {
+void GrContext::addResourceToCache(const GrResourceKey& resourceKey, GrGpuResource* resource) {
fResourceCache->purgeAsNeeded(1, resource->gpuMemorySize());
fResourceCache->addResource(resourceKey, resource);
}
-GrGpuObject* GrContext::findAndRefCachedResource(const GrResourceKey& resourceKey) {
- GrGpuObject* resource = fResourceCache->find(resourceKey);
+GrGpuResource* GrContext::findAndRefCachedResource(const GrResourceKey& resourceKey) {
+ GrGpuResource* resource = fResourceCache->find(resourceKey);
SkSafeRef(resource);
return resource;
}
diff --git a/src/gpu/GrGeometryBuffer.h b/src/gpu/GrGeometryBuffer.h
index 67e91cc..3d57f1d 100644
--- a/src/gpu/GrGeometryBuffer.h
+++ b/src/gpu/GrGeometryBuffer.h
@@ -10,14 +10,14 @@
#ifndef GrGeometryBuffer_DEFINED
#define GrGeometryBuffer_DEFINED
-#include "GrGpuObject.h"
+#include "GrGpuResource.h"
class GrGpu;
/**
* Parent class for vertex and index buffers
*/
-class GrGeometryBuffer : public GrGpuObject {
+class GrGeometryBuffer : public GrGpuResource {
public:
SK_DECLARE_INST_COUNT(GrGeometryBuffer);
@@ -98,7 +98,7 @@
return this->onUpdateData(src, srcSizeInBytes);
}
- // GrGpuObject overrides
+ // GrGpuResource overrides
virtual size_t gpuMemorySize() const { return fGpuMemorySize; }
protected:
@@ -119,7 +119,7 @@
bool fDynamic;
bool fCPUBacked;
- typedef GrGpuObject INHERITED;
+ typedef GrGpuResource INHERITED;
};
#endif
diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp
index 840f8ee..0b49e74 100644
--- a/src/gpu/GrGpu.cpp
+++ b/src/gpu/GrGpu.cpp
@@ -85,14 +85,14 @@
fIndexPool = NULL;
}
-void GrGpu::insertObject(GrGpuObject* object) {
+void GrGpu::insertObject(GrGpuResource* object) {
SkASSERT(NULL != object);
SkASSERT(this == object->getGpu());
fObjectList.addToHead(object);
}
-void GrGpu::removeObject(GrGpuObject* object) {
+void GrGpu::removeObject(GrGpuResource* object) {
SkASSERT(NULL != object);
SkASSERT(this == object->getGpu());
diff --git a/src/gpu/GrGpu.h b/src/gpu/GrGpu.h
index 822deb1..b752f7c 100644
--- a/src/gpu/GrGpu.h
+++ b/src/gpu/GrGpu.h
@@ -249,28 +249,28 @@
size_t rowBytes);
/**
- * Called to tell GrGpu that all GrGpuObjects have been lost and should
+ * Called to tell GrGpu that all GrGpuResources have been lost and should
* be abandoned. Overrides must call INHERITED::abandonResources().
*/
virtual void abandonResources();
/**
- * Called to tell GrGpu to release all GrGpuObjects. Overrides must call
+ * Called to tell GrGpu to release all GrGpuResources. Overrides must call
* INHERITED::releaseResources().
*/
void releaseResources();
/**
- * Add object to list of objects. Should only be called by GrGpuObject.
+ * Add object to list of objects. Should only be called by GrGpuResource.
* @param resource the resource to add.
*/
- void insertObject(GrGpuObject* object);
+ void insertObject(GrGpuResource* object);
/**
- * Remove object from list of objects. Should only be called by GrGpuObject.
+ * Remove object from list of objects. Should only be called by GrGpuResource.
* @param resource the resource to remove.
*/
- void removeObject(GrGpuObject* object);
+ void removeObject(GrGpuResource* object);
// GrDrawTarget overrides
virtual void clear(const SkIRect* rect,
@@ -526,7 +526,7 @@
enum {
kPreallocGeomPoolStateStackCnt = 4,
};
- typedef SkTInternalLList<GrGpuObject> ObjectList;
+ typedef SkTInternalLList<GrGpuResource> ObjectList;
SkSTArray<kPreallocGeomPoolStateStackCnt, GeometryPoolState, true> fGeomPoolStateStack;
ResetTimestamp fResetTimestamp;
uint32_t fResetBits;
diff --git a/src/gpu/GrGpuObject.cpp b/src/gpu/GrGpuResource.cpp
similarity index 78%
rename from src/gpu/GrGpuObject.cpp
rename to src/gpu/GrGpuResource.cpp
index 4a72a50..8c2dc45 100644
--- a/src/gpu/GrGpuObject.cpp
+++ b/src/gpu/GrGpuResource.cpp
@@ -7,10 +7,10 @@
*/
-#include "GrGpuObject.h"
+#include "GrGpuResource.h"
#include "GrGpu.h"
-GrGpuObject::GrGpuObject(GrGpu* gpu, bool isWrapped)
+GrGpuResource::GrGpuResource(GrGpu* gpu, bool isWrapped)
: fRefCnt(1)
, fCacheEntry(NULL)
, fUniqueID(CreateUniqueID()) {
@@ -23,13 +23,13 @@
fGpu->insertObject(this);
}
-GrGpuObject::~GrGpuObject() {
+GrGpuResource::~GrGpuResource() {
SkASSERT(0 == fRefCnt);
// subclass should have released this.
SkASSERT(this->wasDestroyed());
}
-void GrGpuObject::release() {
+void GrGpuResource::release() {
if (NULL != fGpu) {
this->onRelease();
fGpu->removeObject(this);
@@ -37,7 +37,7 @@
}
}
-void GrGpuObject::abandon() {
+void GrGpuResource::abandon() {
if (NULL != fGpu) {
this->onAbandon();
fGpu->removeObject(this);
@@ -45,7 +45,7 @@
}
}
-const GrContext* GrGpuObject::getContext() const {
+const GrContext* GrGpuResource::getContext() const {
if (NULL != fGpu) {
return fGpu->getContext();
} else {
@@ -53,7 +53,7 @@
}
}
-GrContext* GrGpuObject::getContext() {
+GrContext* GrGpuResource::getContext() {
if (NULL != fGpu) {
return fGpu->getContext();
} else {
@@ -61,7 +61,7 @@
}
}
-uint32_t GrGpuObject::CreateUniqueID() {
+uint32_t GrGpuResource::CreateUniqueID() {
static int32_t gUniqueID = SK_InvalidUniqueID;
uint32_t id;
do {
diff --git a/src/gpu/GrPath.h b/src/gpu/GrPath.h
index 2c0040c..a571935 100644
--- a/src/gpu/GrPath.h
+++ b/src/gpu/GrPath.h
@@ -8,13 +8,13 @@
#ifndef GrPath_DEFINED
#define GrPath_DEFINED
-#include "GrGpuObject.h"
+#include "GrGpuResource.h"
#include "GrResourceCache.h"
#include "SkPath.h"
#include "SkRect.h"
#include "SkStrokeRec.h"
-class GrPath : public GrGpuObject {
+class GrPath : public GrGpuResource {
public:
SK_DECLARE_INST_COUNT(GrPath);
@@ -45,7 +45,7 @@
SkRect fBounds;
private:
- typedef GrGpuObject INHERITED;
+ typedef GrGpuResource INHERITED;
};
#endif
diff --git a/src/gpu/GrPathRange.h b/src/gpu/GrPathRange.h
index 02342c4..c53b987 100644
--- a/src/gpu/GrPathRange.h
+++ b/src/gpu/GrPathRange.h
@@ -8,7 +8,7 @@
#ifndef GrPathRange_DEFINED
#define GrPathRange_DEFINED
-#include "GrGpuObject.h"
+#include "GrGpuResource.h"
#include "GrResourceCache.h"
#include "SkStrokeRec.h"
@@ -20,7 +20,7 @@
* initialized lazily. Unititialized paths are silently ignored by drawing
* functions.
*/
-class GrPathRange : public GrGpuObject {
+class GrPathRange : public GrGpuResource {
public:
SK_DECLARE_INST_COUNT(GrPathRange);
@@ -54,7 +54,7 @@
SkStrokeRec fStroke;
private:
- typedef GrGpuObject INHERITED;
+ typedef GrGpuResource INHERITED;
};
#endif
diff --git a/src/gpu/GrResourceCache.cpp b/src/gpu/GrResourceCache.cpp
index 13568e4..e3a17f0 100644
--- a/src/gpu/GrResourceCache.cpp
+++ b/src/gpu/GrResourceCache.cpp
@@ -9,13 +9,13 @@
#include "GrResourceCache.h"
-#include "GrGpuObject.h"
+#include "GrGpuResource.h"
DECLARE_SKMESSAGEBUS_MESSAGE(GrResourceInvalidatedMessage);
///////////////////////////////////////////////////////////////////////////////
-void GrGpuObject::didChangeGpuMemorySize() const {
+void GrGpuResource::didChangeGpuMemorySize() const {
if (this->isInCache()) {
fCacheEntry->didChangeResourceSize();
}
@@ -38,7 +38,7 @@
GrResourceCacheEntry::GrResourceCacheEntry(GrResourceCache* resourceCache,
const GrResourceKey& key,
- GrGpuObject* resource)
+ GrGpuResource* resource)
: fResourceCache(resourceCache),
fKey(key),
fResource(resource),
@@ -197,7 +197,7 @@
}
};
-GrGpuObject* GrResourceCache::find(const GrResourceKey& key, uint32_t ownershipFlags) {
+GrGpuResource* GrResourceCache::find(const GrResourceKey& key, uint32_t ownershipFlags) {
GrAutoResourceCacheValidate atcv(this);
GrResourceCacheEntry* entry = NULL;
@@ -226,7 +226,7 @@
}
void GrResourceCache::addResource(const GrResourceKey& key,
- GrGpuObject* resource,
+ GrGpuResource* resource,
uint32_t ownershipFlags) {
SkASSERT(NULL == resource->getCacheEntry());
// we don't expect to create new resources during a purge. In theory
diff --git a/src/gpu/GrResourceCache.h b/src/gpu/GrResourceCache.h
index 63a7a67..235b11a 100644
--- a/src/gpu/GrResourceCache.h
+++ b/src/gpu/GrResourceCache.h
@@ -18,7 +18,7 @@
#include "SkMessageBus.h"
#include "SkTInternalLList.h"
-class GrGpuObject;
+class GrGpuResource;
class GrResourceCache;
class GrResourceCacheEntry;
@@ -29,11 +29,11 @@
return gDomain;
}
- /** Uniquely identifies the GrGpuObject subclass in the key to avoid collisions
+ /** Uniquely identifies the GrGpuResource subclass in the key to avoid collisions
across resource types. */
typedef uint8_t ResourceType;
- /** Flags set by the GrGpuObject subclass. */
+ /** Flags set by the GrGpuResource subclass. */
typedef uint8_t ResourceFlags;
/** Generate a unique ResourceType */
@@ -118,7 +118,7 @@
class GrResourceCacheEntry {
public:
- GrGpuObject* resource() const { return fResource; }
+ GrGpuResource* resource() const { return fResource; }
const GrResourceKey& key() const { return fKey; }
static const GrResourceKey& GetKey(const GrResourceCacheEntry& e) { return e.key(); }
@@ -131,7 +131,7 @@
/**
* Update the cached size for this entry and inform the resource cache that
- * it has changed. Usually invoked from GrGpuObject::didChangeGpuMemorySize,
+ * it has changed. Usually invoked from GrGpuResource::didChangeGpuMemorySize,
* not directly from here.
*/
void didChangeResourceSize();
@@ -139,12 +139,12 @@
private:
GrResourceCacheEntry(GrResourceCache* resourceCache,
const GrResourceKey& key,
- GrGpuObject* resource);
+ GrGpuResource* resource);
~GrResourceCacheEntry();
GrResourceCache* fResourceCache;
GrResourceKey fKey;
- GrGpuObject* fResource;
+ GrGpuResource* fResource;
size_t fCachedSize;
bool fIsExclusive;
@@ -157,7 +157,7 @@
///////////////////////////////////////////////////////////////////////////////
/**
- * Cache of GrGpuObject objects.
+ * Cache of GrGpuResource objects.
*
* These have a corresponding GrResourceKey, built from 128bits identifying the
* resource. Multiple resources can map to same GrResourceKey.
@@ -170,7 +170,7 @@
* For fast searches, we maintain a hash map based on the GrResourceKey.
*
* It is a goal to make the GrResourceCache the central repository and bookkeeper
- * of all resources. It should replace the linked list of GrGpuObjects that
+ * of all resources. It should replace the linked list of GrGpuResources that
* GrGpu uses to call abandon/release.
*/
class GrResourceCache {
@@ -246,8 +246,8 @@
* For a resource to be completely exclusive to a caller both kNoOtherOwners
* and kHide must be specified.
*/
- GrGpuObject* find(const GrResourceKey& key,
- uint32_t ownershipFlags = 0);
+ GrGpuResource* find(const GrResourceKey& key,
+ uint32_t ownershipFlags = 0);
/**
* Add the new resource to the cache (by creating a new cache entry based
@@ -261,7 +261,7 @@
* is called.
*/
void addResource(const GrResourceKey& key,
- GrGpuObject* resource,
+ GrGpuResource* resource,
uint32_t ownershipFlags = 0);
/**
diff --git a/src/gpu/GrStencilAndCoverTextContext.cpp b/src/gpu/GrStencilAndCoverTextContext.cpp
index 0867f2e..0a09a2f 100644
--- a/src/gpu/GrStencilAndCoverTextContext.cpp
+++ b/src/gpu/GrStencilAndCoverTextContext.cpp
@@ -18,7 +18,7 @@
#include "SkPath.h"
#include "SkTextMapStateProc.h"
-class GrStencilAndCoverTextContext::GlyphPathRange : public GrGpuObject {
+class GrStencilAndCoverTextContext::GlyphPathRange : public GrGpuResource {
static const int kMaxGlyphCount = 1 << 16; // Glyph IDs are uint16_t's
static const int kGlyphGroupSize = 16; // Glyphs get tracked in groups of 16
@@ -75,7 +75,7 @@
this->didChangeGpuMemorySize();
}
- // GrGpuObject overrides
+ // GrGpuResource overrides
virtual size_t gpuMemorySize() const SK_OVERRIDE { return fPathRange->gpuMemorySize(); }
private:
@@ -111,7 +111,7 @@
uint8_t fLoadedGlyphs[(kMaxGroupCount + 7) >> 3]; // One bit per glyph group
SkAutoTUnref<GrPathRange> fPathRange;
- typedef GrGpuObject INHERITED;
+ typedef GrGpuResource INHERITED;
};
diff --git a/src/gpu/GrStencilBuffer.h b/src/gpu/GrStencilBuffer.h
index 696ba83..86fef50 100644
--- a/src/gpu/GrStencilBuffer.h
+++ b/src/gpu/GrStencilBuffer.h
@@ -11,12 +11,12 @@
#define GrStencilBuffer_DEFINED
#include "GrClipData.h"
-#include "GrGpuObject.h"
+#include "GrGpuResource.h"
class GrRenderTarget;
class GrResourceKey;
-class GrStencilBuffer : public GrGpuObject {
+class GrStencilBuffer : public GrGpuResource {
public:
SK_DECLARE_INST_COUNT(GrStencilBuffer);
@@ -54,7 +54,7 @@
protected:
GrStencilBuffer(GrGpu* gpu, bool isWrapped, int width, int height, int bits, int sampleCnt)
- : GrGpuObject(gpu, isWrapped)
+ : GrGpuResource(gpu, isWrapped)
, fWidth(width)
, fHeight(height)
, fBits(bits)
@@ -74,7 +74,7 @@
SkIRect fLastClipStackRect;
SkIPoint fLastClipSpaceOffset;
- typedef GrGpuObject INHERITED;
+ typedef GrGpuResource INHERITED;
};
#endif
diff --git a/src/gpu/gl/GrGLVertexArray.h b/src/gpu/gl/GrGLVertexArray.h
index 0e5bffe..f4eb3d5 100644
--- a/src/gpu/gl/GrGLVertexArray.h
+++ b/src/gpu/gl/GrGLVertexArray.h
@@ -8,7 +8,7 @@
#ifndef GrGLVertexArray_DEFINED
#define GrGLVertexArray_DEFINED
-#include "GrGpuObject.h"
+#include "GrGpuResource.h"
#include "GrTypesPriv.h"
#include "gl/GrGLDefines.h"
#include "gl/GrGLFunctions.h"
@@ -130,7 +130,7 @@
* This class represents an OpenGL vertex array object. It manages the lifetime of the vertex array
* and is used to track the state of the vertex array to avoid redundant GL calls.
*/
-class GrGLVertexArray : public GrGpuObject {
+class GrGLVertexArray : public GrGpuResource {
public:
GrGLVertexArray(GrGpuGL* gpu, GrGLint id, int attribCount);
@@ -170,7 +170,7 @@
GrGLuint fIndexBufferID;
bool fIndexBufferIDIsValid;
- typedef GrGpuObject INHERITED;
+ typedef GrGpuResource INHERITED;
};
#endif
diff --git a/tests/ResourceCacheTest.cpp b/tests/ResourceCacheTest.cpp
index b4aab5f..4b43d4f 100644
--- a/tests/ResourceCacheTest.cpp
+++ b/tests/ResourceCacheTest.cpp
@@ -58,7 +58,7 @@
context->setResourceCacheLimits(oldMaxNum, oldMaxBytes);
}
-class TestResource : public GrGpuObject {
+class TestResource : public GrGpuResource {
static const size_t kDefaultSize = 100;
public:
@@ -101,7 +101,7 @@
size_t fSize;
static int fAlive;
- typedef GrGpuObject INHERITED;
+ typedef GrGpuResource INHERITED;
};
int TestResource::fAlive = 0;
@@ -127,7 +127,7 @@
b->unref();
// Add a third independent resource also with the same key.
- GrGpuObject* r = new TestResource(context->getGpu());
+ GrGpuResource* r = new TestResource(context->getGpu());
cache.addResource(key, r);
r->unref();