aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar caryclark <caryclark@google.com>2016-02-09 16:28:46 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-02-09 16:28:46 -0800
commit64e75330916f670cf9db9eb7a850afc325b18645 (patch)
treec58dab2c288218be347258031e0a452dabafb8ec /include
parent77a5b0e1b48845c5b6715c2948df87f5df053696 (diff)
Revert of skia: Add support for CHROMIUM_image backed textures. (patchset #19 id:380001 of https://codereview.chromium.org/1623653002/ )
Reason for revert: Breaks ASAN bot: Direct leak of 56 byte(s) in 1 object(s) allocated from: ... test_CustomTexture https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Ubuntu-GCC-Golo-GPU-GT610-x86_64-Debug-ASAN/builds/2676/steps/dm/logs/stdio Original issue's description: > skia: Add support for CHROMIUM_image backed textures. > > I created a new abstract base class TextureStorageAllocator that consumers of > Skia can subclass and pass back to Skia. When a surface is created with a > pointer to a TextureStorageAllocator, any textures it creates, or that are > derived from the original surface, will allocate and deallocate storage using > the methods on TextureStorageAllocator. > > BUG=https://code.google.com/p/chromium/issues/detail?id=579664 > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1623653002 > > Committed: https://skia.googlesource.com/skia/+/92098e691f10a010e7421125ba4d44c02506bb55 > > Committed: https://skia.googlesource.com/skia/+/7fec91ce6660190f8d7c5eb6f3061e4550cc672b > > Committed: https://skia.googlesource.com/skia/+/b8d6e088590160f1198110c2371b802c1d541a36 TBR=bsalomon@chromium.org,cblume@chromium.org,bsalomon@google.com,robertphillips@google.com,egdaniel@google.com,reed@google.com,erikchen@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=https://code.google.com/p/chromium/issues/detail?id=579664 Review URL: https://codereview.chromium.org/1684993002
Diffstat (limited to 'include')
-rw-r--r--include/core/SkSurface.h10
-rw-r--r--include/gpu/GrTypes.h64
2 files changed, 6 insertions, 68 deletions
diff --git a/include/core/SkSurface.h b/include/core/SkSurface.h
index 45262d78e6..52097be66e 100644
--- a/include/core/SkSurface.h
+++ b/include/core/SkSurface.h
@@ -120,16 +120,12 @@ public:
/**
* Return a new surface whose contents will be drawn to an offscreen
* render target, allocated by the surface.
- *
- * The GrTextureStorageAllocator will be reused if SkImage snapshots create
- * additional textures.
*/
- static SkSurface* NewRenderTarget(
- GrContext*, Budgeted, const SkImageInfo&, int sampleCount, const SkSurfaceProps* = NULL,
- GrTextureStorageAllocator = GrTextureStorageAllocator());
+ static SkSurface* NewRenderTarget(GrContext*, Budgeted, const SkImageInfo&, int sampleCount,
+ const SkSurfaceProps* = NULL);
static SkSurface* NewRenderTarget(GrContext* gr, Budgeted b, const SkImageInfo& info) {
- return NewRenderTarget(gr, b, info, 0);
+ return NewRenderTarget(gr, b, info, 0, NULL);
}
int width() const { return fWidth; }
diff --git a/include/gpu/GrTypes.h b/include/gpu/GrTypes.h
index 767e07206e..dbcb9a6583 100644
--- a/include/gpu/GrTypes.h
+++ b/include/gpu/GrTypes.h
@@ -409,9 +409,6 @@ enum GrSurfaceFlags {
GR_MAKE_BITFIELD_OPS(GrSurfaceFlags)
-// opaque type for 3D API object handles
-typedef intptr_t GrBackendObject;
-
/**
* Some textures will be stored such that the upper and left edges of the content meet at the
* the origin (in texture coord space) and for other textures the lower and left edges meet at
@@ -426,58 +423,6 @@ enum GrSurfaceOrigin {
};
/**
- * An container of function pointers which consumers of Skia can fill in and
- * pass to Skia. Skia will use these function pointers in place of its backend
- * API texture creation function. Either all of the function pointers should be
- * filled in, or they should all be nullptr.
- */
-struct GrTextureStorageAllocator {
- GrTextureStorageAllocator()
- : fAllocateTextureStorage(nullptr)
- , fDeallocateTextureStorage(nullptr) {
- }
-
- enum class Result {
- kSucceededAndUploaded,
- kSucceededWithoutUpload,
- kFailed
- };
- typedef Result (*AllocateTextureStorageProc)(
- void* ctx, GrBackendObject texture, unsigned width,
- unsigned height, GrPixelConfig config, const void* srcData, GrSurfaceOrigin);
- typedef void (*DeallocateTextureStorageProc)(void* ctx, GrBackendObject texture);
-
- /*
- * Generates and binds a texture to |textureStorageTarget()|. Allocates
- * storage for the texture.
- *
- * In OpenGL, the MIN and MAX filters for the created texture must be
- * GL_LINEAR. The WRAP_S and WRAP_T must be GL_CLAMP_TO_EDGE.
- *
- * If |srcData| is not nullptr, then the implementation of this function
- * may attempt to upload the data into the texture. On successful upload,
- * or if |srcData| is nullptr, returns kSucceededAndUploaded.
- */
- AllocateTextureStorageProc fAllocateTextureStorage;
-
- /*
- * Deallocate the storage for the given texture.
- *
- * Skia does not always destroy its outstanding textures. See
- * GrContext::abandonContext() for more details. The consumer of Skia is
- * responsible for making sure that all textures are destroyed, even if this
- * callback is not invoked.
- */
- DeallocateTextureStorageProc fDeallocateTextureStorage;
-
- /*
- * The context to use when invoking fAllocateTextureStorage and
- * fDeallocateTextureStorage.
- */
- void* fCtx;
-};
-
-/**
* Describes a surface to be created.
*/
struct GrSurfaceDesc {
@@ -509,12 +454,6 @@ struct GrSurfaceDesc {
* max supported count.
*/
int fSampleCnt;
-
- /**
- * A custom platform-specific allocator to use in place of the backend APIs
- * usual texture creation method (e.g. TexImage2D in OpenGL).
- */
- GrTextureStorageAllocator fTextureStorageAllocator;
};
// Legacy alias
@@ -530,6 +469,9 @@ enum GrClipType {
///////////////////////////////////////////////////////////////////////////////
+// opaque type for 3D API object handles
+typedef intptr_t GrBackendObject;
+
/** Ownership rules for external GPU resources imported into Skia. */
enum GrWrapOwnership {