diff options
author | 2016-03-25 04:55:58 -0700 | |
---|---|---|
committer | 2016-03-25 04:55:59 -0700 | |
commit | f8c3ba40cf4f42b2c2ba1b473c28d7733383223e (patch) | |
tree | 00c671765311aaa35c8a9d6fa0a6b84907c871b9 /src/gpu/gl/GrGLBuffer.h | |
parent | f299e7105435829c47e94f4cf6e408cad675bc77 (diff) |
Revert of Consolidate GPU buffer implementations (patchset #10 id:180001 of https://codereview.chromium.org/1825393002/ )
Reason for revert:
Lots of Android redness
Original issue's description:
> Consolidate GPU buffer implementations
>
> Consolidates all the different buffer implementations into a single
> GrBuffer class. This will allow us to add new buffer types, use DSA in
> OpenGL, track buffer bindings by unique ID, cache buffers without
> respect to the type of data they have been used for previously, etc.
> This change is strictly a refactor; it introduces no change in
> functionality.
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1825393002
>
> Committed: https://skia.googlesource.com/skia/+/8b1bff29675afd25843439eade634a57f68fe16f
TBR=bsalomon@google.com,egdaniel@google.com,jvanverth@google.com,cdalton@nvidia.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:
Review URL: https://codereview.chromium.org/1831133004
Diffstat (limited to 'src/gpu/gl/GrGLBuffer.h')
-rw-r--r-- | src/gpu/gl/GrGLBuffer.h | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/src/gpu/gl/GrGLBuffer.h b/src/gpu/gl/GrGLBuffer.h deleted file mode 100644 index 90d2c43dfa..0000000000 --- a/src/gpu/gl/GrGLBuffer.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2016 Google Inc. - * - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -#ifndef GrGLBuffer_DEFINED -#define GrGLBuffer_DEFINED - -#include "GrBuffer.h" -#include "gl/GrGLTypes.h" - -class GrGLGpu; -class GrGLCaps; - -class GrGLBuffer : public GrBuffer { -public: - static GrGLBuffer* Create(GrGLGpu*, GrBufferType, size_t size, GrAccessPattern); - - ~GrGLBuffer() { - // either release or abandon should have been called by the owner of this object. - SkASSERT(0 == fBufferID); - } - - GrGLenum target() const { return fTarget; } - GrGLuint bufferID() const { return fBufferID; } - size_t baseOffset() const { return reinterpret_cast<size_t>(fCPUData); } - -protected: - GrGLBuffer(GrGLGpu*, GrBufferType, size_t size, GrAccessPattern, bool cpuBacked); - - void onAbandon() override; - void onRelease() override; - void setMemoryBacking(SkTraceMemoryDump* traceMemoryDump, - const SkString& dumpName) const override; - -private: - GrGLGpu* glGpu() const; - const GrGLCaps& glCaps() const; - - void onMap() override; - void onUnmap() override; - bool onUpdateData(const void* src, size_t srcSizeInBytes) override; - -#ifdef SK_DEBUG - void validate() const; -#endif - - void* fCPUData; - GrGLenum fTarget; // GL_ARRAY_BUFFER or GL_ELEMENT_ARRAY_BUFFER, e.g. - GrGLuint fBufferID; - size_t fSizeInBytes; - GrGLenum fUsage; - size_t fGLSizeInBytes; // In certain cases we make the size of the GL buffer object - // smaller or larger than the size in fDesc. - - typedef GrBuffer INHERITED; -}; - -#endif |