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

Side by Side Diff: gpu/command_buffer/service/gles2_cmd_decoder.cc

Issue 13543007: GLImage support for Android zero-copy pixel buffers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: s/window/buffer/ Created 7 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | ui/gfx/native_widget_types.h » ('j') | ui/gl/gl_image_egl.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h"
6 6
7 #include <stdio.h> 7 #include <stdio.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <list> 10 #include <list>
(...skipping 10072 matching lines...) Expand 10 before | Expand all | Expand 10 after
10083 } 10083 }
10084 10084
10085 gfx::GLImage* gl_image = image_manager()->LookupImage(image_id); 10085 gfx::GLImage* gl_image = image_manager()->LookupImage(image_id);
10086 if (!gl_image) { 10086 if (!gl_image) {
10087 LOCAL_SET_GL_ERROR( 10087 LOCAL_SET_GL_ERROR(
10088 GL_INVALID_OPERATION, 10088 GL_INVALID_OPERATION,
10089 "glBindTexImage2DCHROMIUM", "no image found with the given ID"); 10089 "glBindTexImage2DCHROMIUM", "no image found with the given ID");
10090 return; 10090 return;
10091 } 10091 }
10092 10092
10093 if (!gl_image->BindTexImage()) { 10093 {
10094 LOCAL_SET_GL_ERROR( 10094 ScopedGLErrorSuppressor suppressor(
10095 GL_INVALID_OPERATION, 10095 "GLES2DecoderImpl::DoBindTexImage2DCHROMIUM", decoder_);
10096 "glBindTexImage2DCHROMIUM", "fail to bind image with the given ID"); 10096 if (!gl_image->BindTexImage()) {
10097 return; 10097 LOCAL_SET_GL_ERROR(
10098 GL_INVALID_OPERATION,
10099 "glBindTexImage2DCHROMIUM", "fail to bind image with the given ID");
10100 return;
10101 }
10098 } 10102 }
10099 10103
10100 gfx::Size size = gl_image->GetSize(); 10104 gfx::Size size = gl_image->GetSize();
10101 texture_manager()->SetLevelInfo( 10105 texture_manager()->SetLevelInfo(
10102 texture, target, 0, GL_RGBA, size.width(), size.height(), 1, 0, 10106 texture, target, 0, GL_RGBA, size.width(), size.height(), 1, 0,
10103 GL_RGBA, GL_UNSIGNED_BYTE, true); 10107 GL_RGBA, GL_UNSIGNED_BYTE, true);
10104 texture_manager()->SetLevelImage(texture, target, 0, gl_image); 10108 texture_manager()->SetLevelImage(texture, target, 0, gl_image);
10105 } 10109 }
10106 10110
10107 void GLES2DecoderImpl::DoReleaseTexImage2DCHROMIUM( 10111 void GLES2DecoderImpl::DoReleaseTexImage2DCHROMIUM(
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
10466 return error::kNoError; 10470 return error::kNoError;
10467 } 10471 }
10468 10472
10469 // Include the auto-generated part of this file. We split this because it means 10473 // Include the auto-generated part of this file. We split this because it means
10470 // we can easily edit the non-auto generated parts right here in this file 10474 // we can easily edit the non-auto generated parts right here in this file
10471 // instead of having to edit some template or the code generator. 10475 // instead of having to edit some template or the code generator.
10472 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" 10476 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h"
10473 10477
10474 } // namespace gles2 10478 } // namespace gles2
10475 } // namespace gpu 10479 } // namespace gpu
OLDNEW
« no previous file with comments | « no previous file | ui/gfx/native_widget_types.h » ('j') | ui/gl/gl_image_egl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698