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

Unified Diff: include/gpu/GrTextureProvider.h

Issue 1565313003: Revert of Add guards to GrTextureProvider (Closed) Base URL: https://skia.googlesource.com/skia.git@gpudeviceguards
Patch Set: Created 4 years, 11 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 | « include/gpu/GrDrawContext.h ('k') | src/gpu/GrContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/GrTextureProvider.h
diff --git a/include/gpu/GrTextureProvider.h b/include/gpu/GrTextureProvider.h
index 46f381da81f1fd5b5c0cdd82ba13829d95f58c52..5635583d80fef393a746ae75f32edc0d2a3c8025 100644
--- a/include/gpu/GrTextureProvider.h
+++ b/include/gpu/GrTextureProvider.h
@@ -10,8 +10,6 @@
#include "GrTexture.h"
#include "SkImageFilter.h"
-
-class GrSingleOwner;
class SK_API GrTextureProvider {
public:
@@ -44,7 +42,15 @@
}
/** Finds a texture by unique key. If the texture is found it is ref'ed and returned. */
- GrTexture* findAndRefTextureByUniqueKey(const GrUniqueKey& key);
+ GrTexture* findAndRefTextureByUniqueKey(const GrUniqueKey& key) {
+ GrGpuResource* resource = this->findAndRefResourceByUniqueKey(key);
+ if (resource) {
+ GrTexture* texture = static_cast<GrSurface*>(resource)->asTexture();
+ SkASSERT(texture);
+ return texture;
+ }
+ return NULL;
+ }
/**
* Determines whether a texture is associated with the unique key. If the texture is found it
@@ -128,7 +134,7 @@
GrRenderTarget* wrapBackendRenderTarget(const GrBackendRenderTargetDesc& desc);
protected:
- GrTextureProvider(GrGpu* gpu, GrResourceCache* cache, GrSingleOwner* singleOwner);
+ GrTextureProvider(GrGpu* gpu, GrResourceCache* cache) : fCache(cache), fGpu(gpu) {}
/**
* Assigns a unique key to a resource. If the key is associated with another resource that
@@ -180,9 +186,6 @@
private:
GrResourceCache* fCache;
GrGpu* fGpu;
-
- // In debug builds we guard against improper thread handling
- SkDEBUGCODE(mutable GrSingleOwner* fSingleOwner;)
};
#endif
« no previous file with comments | « include/gpu/GrDrawContext.h ('k') | src/gpu/GrContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698