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

Side by Side Diff: src/gpu/gl/SkGLContextHelper.cpp

Issue 62163004: Added support for Chrome's gpu command buffer extension BindUniformLocation. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« src/gpu/gl/GrGpuGL.cpp ('K') | « src/gpu/gl/GrGpuGL.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2013 Google Inc. 3 * Copyright 2013 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #include "gl/SkGLContextHelper.h" 8 #include "gl/SkGLContextHelper.h"
9 #include "GrGLUtil.h" 9 #include "GrGLUtil.h"
10 10
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 if (!fGL->validate(bindingInUse) || !fExtensions.init(bindingInUse, fGL) ) { 44 if (!fGL->validate(bindingInUse) || !fExtensions.init(bindingInUse, fGL) ) {
45 fGL = NULL; 45 fGL = NULL;
46 this->destroyGLContext(); 46 this->destroyGLContext();
47 return false; 47 return false;
48 } 48 }
49 49
50 SK_GL_RET(*this, temp, GetString(GR_GL_VERSION)); 50 SK_GL_RET(*this, temp, GetString(GR_GL_VERSION));
51 const char* versionStr = reinterpret_cast<const char*>(temp); 51 const char* versionStr = reinterpret_cast<const char*>(temp);
52 GrGLVersion version = GrGLGetVersionFromString(versionStr); 52 GrGLVersion version = GrGLGetVersionFromString(versionStr);
53 53
54 #ifdef SK_DEBUG
bsalomon 2013/11/07 15:06:59 This file should only be used in our test programs
slavi 2013/11/07 20:53:29 Done.
54 // clear any existing GL erorrs 55 // clear any existing GL erorrs
55 GrGLenum error; 56 GrGLenum error;
56 do { 57 do {
57 SK_GL_RET(*this, error, GetError()); 58 SK_GL_RET(*this, error, GetError());
58 } while (GR_GL_NO_ERROR != error); 59 } while (GR_GL_NO_ERROR != error);
60 #endif
59 61
60 SK_GL(*this, GenFramebuffers(1, &fFBO)); 62 SK_GL(*this, GenFramebuffers(1, &fFBO));
61 SK_GL(*this, BindFramebuffer(GR_GL_FRAMEBUFFER, fFBO)); 63 SK_GL(*this, BindFramebuffer(GR_GL_FRAMEBUFFER, fFBO));
62 SK_GL(*this, GenRenderbuffers(1, &fColorBufferID)); 64 SK_GL(*this, GenRenderbuffers(1, &fColorBufferID));
63 SK_GL(*this, BindRenderbuffer(GR_GL_RENDERBUFFER, fColorBufferID)); 65 SK_GL(*this, BindRenderbuffer(GR_GL_RENDERBUFFER, fColorBufferID));
64 if (kES_GrGLBinding == bindingInUse) { 66 if (kES_GrGLBinding == bindingInUse) {
65 SK_GL(*this, RenderbufferStorage(GR_GL_RENDERBUFFER, 67 SK_GL(*this, RenderbufferStorage(GR_GL_RENDERBUFFER,
66 GR_GL_RGBA8, 68 GR_GL_RGBA8,
67 width, height)); 69 width, height));
68 } else { 70 } else {
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 width, height)); 114 width, height));
113 } 115 }
114 SK_GL(*this, FramebufferRenderbuffer(GR_GL_FRAMEBUFFER, 116 SK_GL(*this, FramebufferRenderbuffer(GR_GL_FRAMEBUFFER,
115 GR_GL_STENCIL_ATTACHMENT, 117 GR_GL_STENCIL_ATTACHMENT,
116 GR_GL_RENDERBUFFER, 118 GR_GL_RENDERBUFFER,
117 fDepthStencilBufferID)); 119 fDepthStencilBufferID));
118 SK_GL(*this, Viewport(0, 0, width, height)); 120 SK_GL(*this, Viewport(0, 0, width, height));
119 SK_GL(*this, ClearStencil(0)); 121 SK_GL(*this, ClearStencil(0));
120 SK_GL(*this, Clear(GR_GL_STENCIL_BUFFER_BIT)); 122 SK_GL(*this, Clear(GR_GL_STENCIL_BUFFER_BIT));
121 123
124 #ifdef SK_DEBUG
122 SK_GL_RET(*this, error, GetError()); 125 SK_GL_RET(*this, error, GetError());
123 GrGLenum status; 126 GrGLenum status;
124 SK_GL_RET(*this, status, CheckFramebufferStatus(GR_GL_FRAMEBUFFER)); 127 SK_GL_RET(*this, status, CheckFramebufferStatus(GR_GL_FRAMEBUFFER));
125 128
126 if (GR_GL_FRAMEBUFFER_COMPLETE != status || 129 if (GR_GL_FRAMEBUFFER_COMPLETE != status ||
127 GR_GL_NO_ERROR != error) { 130 GR_GL_NO_ERROR != error) {
128 fFBO = 0; 131 fFBO = 0;
129 fColorBufferID = 0; 132 fColorBufferID = 0;
130 fDepthStencilBufferID = 0; 133 fDepthStencilBufferID = 0;
131 fGL->unref(); 134 fGL->unref();
132 fGL = NULL; 135 fGL = NULL;
133 this->destroyGLContext(); 136 this->destroyGLContext();
134 return false; 137 return false;
135 } else { 138 } else {
136 return true; 139 return true;
137 } 140 }
141 #else
142 return true;
143 #endif
138 } 144 }
139 return false; 145 return false;
140 } 146 }
OLDNEW
« src/gpu/gl/GrGpuGL.cpp ('K') | « src/gpu/gl/GrGpuGL.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698