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

Unified Diff: src/gpu/gl/GrGLTextureRenderTarget.h

Issue 695813003: Add class GrGLTextureRenderTarget for GL texture/rendertarget objects (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: cleanup Created 6 years, 2 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
Index: src/gpu/gl/GrGLTextureRenderTarget.h
diff --git a/src/gpu/gl/GrGLTextureRenderTarget.h b/src/gpu/gl/GrGLTextureRenderTarget.h
new file mode 100644
index 0000000000000000000000000000000000000000..656124aacdec9151a39a6d5e710da8c5b073b1f7
--- /dev/null
+++ b/src/gpu/gl/GrGLTextureRenderTarget.h
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2014 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+
+#ifndef GrGLTextureRenderTarget_DEFINED
+#define GrGLTextureRenderTarget_DEFINED
+
+#include "GrGLTexture.h"
+#include "GrGLRenderTarget.h"
+
+class GrGpuGL;
+
+#ifdef SK_BUILD_FOR_WIN
+// Windows gives bogus warnings about inheriting asTexture/asRenderTarget via dominance.
+#pragma warning(push)
+#pragma warning(disable: 4250)
+#endif
+
+class GrGLTextureRenderTarget : public GrGLTexture, public GrGLRenderTarget {
+public:
+ GrGLTextureRenderTarget(GrGpuGL* gpu,
+ const GrSurfaceDesc& desc,
+ const GrGLTexture::IDDesc& texIDDesc,
+ const GrGLRenderTarget::IDDesc& rtIDDesc)
+ : GrGLTexture(gpu, desc, texIDDesc, GrGLTexture::kDerived)
+ , GrGLRenderTarget(gpu, desc, rtIDDesc, GrGLRenderTarget::kDerived)
robertphillips 2014/11/03 13:58:55 // Both GrRenderTarget and GrTexture virtually der
bsalomon 2014/11/03 15:20:15 Done.
+ , GrSurface(gpu, texIDDesc.fIsWrapped, desc) {
+ this->registerWithCache();
+ }
+
+ virtual ~GrGLTextureRenderTarget() { this->release(); }
+
+ // GrGLRenderTarget accounts for the texture's memory and any MSAA renderbuffer's memory.
robertphillips 2014/11/03 13:58:55 this-> ?
bsalomon 2014/11/03 15:20:15 The class name scope takes the place of "this->".
+ virtual size_t gpuMemorySize() const SK_OVERRIDE { return GrGLRenderTarget::gpuMemorySize(); }
+
+protected:
robertphillips 2014/11/03 13:58:54 overlength ? this-> ?
bsalomon 2014/11/03 15:20:15 wrapped
+ virtual void onAbandon() SK_OVERRIDE { GrGLRenderTarget::onAbandon(); GrGLTexture::onAbandon(); }
+ virtual void onRelease() SK_OVERRIDE { GrGLRenderTarget::onRelease(); GrGLTexture::onRelease(); }
+};
+
+#ifdef SK_BUILD_FOR_WIN
+#pragma warning(pop)
+#endif
+
+#endif

Powered by Google App Engine
This is Rietveld 408576698