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/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)