Skip to content
Snippets Groups Projects
Commit aebb4928 authored by gman@google.com's avatar gman@google.com
Browse files

fix for gl cb

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26892 0039d316-1c4b-4281-b951-d872f2087c98
parent 9dcb5966
No related merge requests found
...@@ -118,11 +118,11 @@ BufferSyncInterface::ParseError GAPIGL::CreateRenderSurface( ...@@ -118,11 +118,11 @@ BufferSyncInterface::ParseError GAPIGL::CreateRenderSurface(
ResourceID texture_id) { ResourceID texture_id) {
if (id == current_surface_id_) { if (id == current_surface_id_) {
// This will delete the current surface which would be bad. // This will delete the current surface which would be bad.
return BufferSyncInterface::PARSE_INVALID_ARGUMENTS; return BufferSyncInterface::kParseInvalidArguments;
} }
TextureGL *texture = textures_.Get(texture_id); TextureGL *texture = textures_.Get(texture_id);
if (!texture->render_surfaces_enabled()) { if (!texture->render_surfaces_enabled()) {
return BufferSyncInterface::PARSE_INVALID_ARGUMENTS; return BufferSyncInterface::kParseInvalidArguments;
} else { } else {
RenderSurfaceGL* render_surface = RenderSurfaceGL::Create(width, RenderSurfaceGL* render_surface = RenderSurfaceGL::Create(width,
height, height,
...@@ -130,20 +130,20 @@ BufferSyncInterface::ParseError GAPIGL::CreateRenderSurface( ...@@ -130,20 +130,20 @@ BufferSyncInterface::ParseError GAPIGL::CreateRenderSurface(
side, side,
texture); texture);
if (render_surface == NULL) { if (render_surface == NULL) {
return BufferSyncInterface::PARSE_INVALID_ARGUMENTS; return BufferSyncInterface::kParseInvalidArguments;
} }
render_surfaces_.Assign(id, render_surface); render_surfaces_.Assign(id, render_surface);
} }
return BufferSyncInterface::PARSE_NO_ERROR; return BufferSyncInterface::kParseNoError;
} }
BufferSyncInterface::ParseError GAPIGL::DestroyRenderSurface(ResourceID id) { BufferSyncInterface::ParseError GAPIGL::DestroyRenderSurface(ResourceID id) {
if (id == current_surface_id_) { if (id == current_surface_id_) {
return BufferSyncInterface::PARSE_INVALID_ARGUMENTS; return BufferSyncInterface::kParseInvalidArguments;
} }
return render_surfaces_.Destroy(id) ? return render_surfaces_.Destroy(id) ?
BufferSyncInterface::PARSE_NO_ERROR : BufferSyncInterface::kParseNoError :
BufferSyncInterface::PARSE_INVALID_ARGUMENTS; BufferSyncInterface::kParseInvalidArguments;
} }
BufferSyncInterface::ParseError GAPIGL::CreateDepthSurface( BufferSyncInterface::ParseError GAPIGL::CreateDepthSurface(
...@@ -152,24 +152,24 @@ BufferSyncInterface::ParseError GAPIGL::CreateDepthSurface( ...@@ -152,24 +152,24 @@ BufferSyncInterface::ParseError GAPIGL::CreateDepthSurface(
unsigned int height) { unsigned int height) {
if (id == current_depth_surface_id_) { if (id == current_depth_surface_id_) {
// This will delete the current surface which would be bad. // This will delete the current surface which would be bad.
return BufferSyncInterface::PARSE_INVALID_ARGUMENTS; return BufferSyncInterface::kParseInvalidArguments;
} }
RenderDepthStencilSurfaceGL* depth_surface = RenderDepthStencilSurfaceGL* depth_surface =
RenderDepthStencilSurfaceGL::Create(width, height); RenderDepthStencilSurfaceGL::Create(width, height);
if (depth_surface == NULL) { if (depth_surface == NULL) {
return BufferSyncInterface::PARSE_INVALID_ARGUMENTS; return BufferSyncInterface::kParseInvalidArguments;
} }
depth_surfaces_.Assign(id, depth_surface); depth_surfaces_.Assign(id, depth_surface);
return BufferSyncInterface::PARSE_NO_ERROR; return BufferSyncInterface::kParseNoError;
} }
BufferSyncInterface::ParseError GAPIGL::DestroyDepthSurface(ResourceID id) { BufferSyncInterface::ParseError GAPIGL::DestroyDepthSurface(ResourceID id) {
if (id == current_depth_surface_id_) { if (id == current_depth_surface_id_) {
return BufferSyncInterface::PARSE_INVALID_ARGUMENTS; return BufferSyncInterface::kParseInvalidArguments;
} }
return depth_surfaces_.Destroy(id) ? return depth_surfaces_.Destroy(id) ?
BufferSyncInterface::PARSE_NO_ERROR : BufferSyncInterface::kParseNoError :
BufferSyncInterface::PARSE_INVALID_ARGUMENTS; BufferSyncInterface::kParseInvalidArguments;
} }
void ResetBoundAttachments() { void ResetBoundAttachments() {
...@@ -224,7 +224,7 @@ BufferSyncInterface::ParseError GAPIGL::SetRenderSurface( ...@@ -224,7 +224,7 @@ BufferSyncInterface::ParseError GAPIGL::SetRenderSurface(
ResourceID depth_stencil_id) { ResourceID depth_stencil_id) {
if (render_surfaces_.Get(render_surface_id) == NULL && if (render_surfaces_.Get(render_surface_id) == NULL &&
depth_surfaces_.Get(depth_stencil_id) == NULL) { depth_surfaces_.Get(depth_stencil_id) == NULL) {
return BufferSyncInterface::PARSE_INVALID_ARGUMENTS; return BufferSyncInterface::kParseInvalidArguments;
} }
::glBindFramebufferEXT(GL_FRAMEBUFFER, render_surface_framebuffer_); ::glBindFramebufferEXT(GL_FRAMEBUFFER, render_surface_framebuffer_);
...@@ -237,7 +237,7 @@ BufferSyncInterface::ParseError GAPIGL::SetRenderSurface( ...@@ -237,7 +237,7 @@ BufferSyncInterface::ParseError GAPIGL::SetRenderSurface(
if (!render_surface->texture()-> if (!render_surface->texture()->
InstallFrameBufferObjects(render_surface) || InstallFrameBufferObjects(render_surface) ||
!BindDepthStencilBuffer(depth_surface)) { !BindDepthStencilBuffer(depth_surface)) {
return BufferSyncInterface::PARSE_INVALID_ARGUMENTS; return BufferSyncInterface::kParseInvalidArguments;
} }
// RenderSurface rendering is performed with an inverted Y, so the front // RenderSurface rendering is performed with an inverted Y, so the front
...@@ -247,7 +247,7 @@ BufferSyncInterface::ParseError GAPIGL::SetRenderSurface( ...@@ -247,7 +247,7 @@ BufferSyncInterface::ParseError GAPIGL::SetRenderSurface(
current_surface_id_ = render_surface_id; current_surface_id_ = render_surface_id;
current_depth_surface_id_ = depth_stencil_id; current_depth_surface_id_ = depth_stencil_id;
return BufferSyncInterface::PARSE_NO_ERROR; return BufferSyncInterface::kParseNoError;
} }
void GAPIGL::SetBackSurfaces() { void GAPIGL::SetBackSurfaces() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment