diff options
author | tomhudson@google.com <tomhudson@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-03-16 17:16:25 +0000 |
---|---|---|
committer | tomhudson@google.com <tomhudson@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-03-16 17:16:25 +0000 |
commit | f97ef2f98ec77da807483715d3c6dc36e12d9c80 (patch) | |
tree | 4491033a4386376ae5618f4f6387269000f2ea3a /obsolete/SkGLDevice_FBO.cpp | |
parent | 022a3e1f3e2bbe76bf2cda6bf63b9d73b6f34c7d (diff) |
Delete 'obsolete' directory, most of whose contents have been there more than a year.
git-svn-id: http://skia.googlecode.com/svn/trunk@3416 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'obsolete/SkGLDevice_FBO.cpp')
-rw-r--r-- | obsolete/SkGLDevice_FBO.cpp | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/obsolete/SkGLDevice_FBO.cpp b/obsolete/SkGLDevice_FBO.cpp deleted file mode 100644 index 2cbafea836..0000000000 --- a/obsolete/SkGLDevice_FBO.cpp +++ /dev/null @@ -1,64 +0,0 @@ - -/* - * 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 "SkGLDevice_FBO.h" -#include "SkRegion.h" - -SkGLDevice_FBO::SkGLDevice_FBO(const SkBitmap& bitmap, bool offscreen) - : SkGLDevice(bitmap, offscreen) { - fFBO = 0; - fTextureID = 0; - - if (offscreen) { - int nw = SkNextPow2(bitmap.rowBytesAsPixels()); - int nh = SkNextPow2(bitmap.height()); - - glGenFramebuffersEXT(1, &fFBO); - glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fFBO); - - glGenTextures(1, &fTextureID); - glBindTexture(GL_TEXTURE_2D, fTextureID); - SkGL::SetTexParamsClamp(false); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, nw, nh, 0, - GL_RGBA, GL_UNSIGNED_BYTE, NULL); - - glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, - GL_TEXTURE_2D, fTextureID, 0); - GLenum status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT); - if (status != GL_FRAMEBUFFER_COMPLETE_EXT) { - SkDebugf("-- glCheckFramebufferStatusEXT %x\n", status); - } - - // now reset back to "normal" drawing target - glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); - } -} - -SkGLDevice_FBO::~SkGLDevice_FBO() { - if (fTextureID) { - glDeleteTextures(1, &fTextureID); - } - if (fFBO) { - glDeleteFramebuffersEXT(1, &fFBO); - } -} - -SkGLDevice::TexOrientation SkGLDevice_FBO::bindDeviceAsTexture() { - if (fTextureID) { - glBindTexture(GL_TEXTURE_2D, fTextureID); - return kBottomToTop_TexOrientation; - } - return kNo_TexOrientation; -} - -void SkGLDevice_FBO::gainFocus(SkCanvas* canvas) { - glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fFBO); - - // now we're ready for the viewport and projection matrix - this->INHERITED::gainFocus(canvas); -} - |