Added GrSurfaceContext and GrTextureContext
This lets copy-to-texture to be treated like copy-to-rt.
To match current behavior, though, copies to texture are
still executed immediately (forcing a flush).
Once MDB is enabled, copies to texture will be deferred.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5093
Change-Id: Icc0ce5435507a5f0a237c22eedef879824952367
Reviewed-on: https://skia-review.googlesource.com/5093
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
diff --git a/include/private/GrRenderTargetProxy.h b/include/private/GrRenderTargetProxy.h
index bfc6e05..83107da 100644
--- a/include/private/GrRenderTargetProxy.h
+++ b/include/private/GrRenderTargetProxy.h
@@ -53,12 +53,6 @@
GrRenderTarget::Flags testingOnly_getFlags() const;
- GrRenderTargetOpList* getLastRenderTargetOpList() {
- return (GrRenderTargetOpList*) this->getLastOpList();
- }
-
- SkDEBUGCODE(void validate(GrContext*) const;)
-
protected:
friend class GrSurfaceProxy; // for ctors
diff --git a/include/private/GrSurfaceProxy.h b/include/private/GrSurfaceProxy.h
index 1ff6df8..61dc9e1 100644
--- a/include/private/GrSurfaceProxy.h
+++ b/include/private/GrSurfaceProxy.h
@@ -13,11 +13,11 @@
#include "SkRect.h"
class GrCaps;
-class GrOpList;
+class GrRenderTargetOpList;
+class GrRenderTargetProxy;
+class GrTextureOpList;
class GrTextureProvider;
class GrTextureProxy;
-class GrRenderTargetProxy;
-class GrTextureProvider;
// This class replicates the functionality GrIORef<GrSurface> but tracks the
// utilitization for later resource allocation (for the deferred case) and
@@ -244,6 +244,9 @@
void setLastOpList(GrOpList* opList);
GrOpList* getLastOpList() { return fLastOpList; }
+ GrRenderTargetOpList* getLastRenderTargetOpList();
+ GrTextureOpList* getLastTextureOpList();
+
/**
* Retrieves the amount of GPU memory that will be or currently is used by this resource
* in bytes. It is approximate since we aren't aware of additional padding or copies made
@@ -261,6 +264,8 @@
bool isWrapped_ForTesting() const;
+ SkDEBUGCODE(void validate(GrContext*) const;)
+
protected:
// Deferred version
GrSurfaceProxy(const GrSurfaceDesc& desc, SkBackingFit fit, SkBudgeted budgeted)
diff --git a/include/private/GrTextureProxy.h b/include/private/GrTextureProxy.h
index a206e76..5eb3066 100644
--- a/include/private/GrTextureProxy.h
+++ b/include/private/GrTextureProxy.h
@@ -12,6 +12,7 @@
#include "GrTexture.h"
class GrCaps;
+class GrTextureOpList;
class GrTextureProvider;
// This class delays the acquisition of textures until they are actually required