Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1594)

Unified Diff: gpu/src/GrGLRenderTarget.cpp

Issue 4806058: move render target decls / defs to their own headers / srcs (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 13 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/src/GrGLRenderTarget.h ('k') | gpu/src/GrGLTexture.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/src/GrGLRenderTarget.cpp
===================================================================
--- gpu/src/GrGLRenderTarget.cpp (revision 0)
+++ gpu/src/GrGLRenderTarget.cpp (revision 0)
@@ -0,0 +1,71 @@
+
+/*
+ * Copyright 2011 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+
+#include "GrGLRenderTarget.h"
+
+#include "GrGpuGL.h"
+
+#define GPUGL static_cast<GrGpuGL*>(getGpu())
+
+GrGLRenderTarget::GrGLRenderTarget(GrGpuGL* gpu,
+ const GLRenderTargetIDs& ids,
+ GrGLTexID* texID,
+ GrPixelConfig config,
+ GrGLuint stencilBits,
+ bool isMultisampled,
+ const GrGLIRect& viewport,
+ GrGLTexture* texture)
+ : INHERITED(gpu, texture, viewport.fWidth,
+ viewport.fHeight, config,
+ stencilBits, isMultisampled) {
+ fRTFBOID = ids.fRTFBOID;
+ fTexFBOID = ids.fTexFBOID;
+ fStencilRenderbufferID = ids.fStencilRenderbufferID;
+ fMSColorRenderbufferID = ids.fMSColorRenderbufferID;
+ fViewport = viewport;
+ fOwnIDs = ids.fOwnIDs;
+ fTexIDObj = texID;
+ GrSafeRef(fTexIDObj);
+}
+
+void GrGLRenderTarget::onRelease() {
+ GPUGL->notifyRenderTargetDelete(this);
+ if (fOwnIDs) {
+ if (fTexFBOID) {
+ GR_GL(DeleteFramebuffers(1, &fTexFBOID));
+ }
+ if (fRTFBOID && fRTFBOID != fTexFBOID) {
+ GR_GL(DeleteFramebuffers(1, &fRTFBOID));
+ }
+ if (fStencilRenderbufferID) {
+ GR_GL(DeleteRenderbuffers(1, &fStencilRenderbufferID));
+ }
+ if (fMSColorRenderbufferID) {
+ GR_GL(DeleteRenderbuffers(1, &fMSColorRenderbufferID));
+ }
+ }
+ fRTFBOID = 0;
+ fTexFBOID = 0;
+ fStencilRenderbufferID = 0;
+ fMSColorRenderbufferID = 0;
+ GrSafeUnref(fTexIDObj);
+ fTexIDObj = NULL;
+}
+
+void GrGLRenderTarget::onAbandon() {
+ fRTFBOID = 0;
+ fTexFBOID = 0;
+ fStencilRenderbufferID = 0;
+ fMSColorRenderbufferID = 0;
+ if (NULL != fTexIDObj) {
+ fTexIDObj->abandon();
+ fTexIDObj = NULL;
+ }
+}
+
Property changes on: gpu\src\GrGLRenderTarget.cpp
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « gpu/src/GrGLRenderTarget.h ('k') | gpu/src/GrGLTexture.h » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b