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

Unified Diff: skia/gl/SkGLDevice_FBO.cpp

Issue 113827: Remove the remainder of the skia source code from the Chromium repo.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 7 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
« no previous file with comments | « skia/gl/SkGLDevice_FBO.h ('k') | skia/gl/SkGLDevice_SWLayer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: skia/gl/SkGLDevice_FBO.cpp
===================================================================
--- skia/gl/SkGLDevice_FBO.cpp (revision 16859)
+++ skia/gl/SkGLDevice_FBO.cpp (working copy)
@@ -1,57 +0,0 @@
-#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);
-}
-
« no previous file with comments | « skia/gl/SkGLDevice_FBO.h ('k') | skia/gl/SkGLDevice_SWLayer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698