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

Side by Side Diff: ppapi/shared_impl/graphics_3d_impl.cc

Issue 7530010: Added PPB_Graphics3D_Dev::Resize to let plugins resize the backing surface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 4 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 | « ppapi/shared_impl/graphics_3d_impl.h ('k') | ppapi/thunk/ppb_graphics_3d_api.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "ppapi/shared_impl/graphics_3d_impl.h" 5 #include "ppapi/shared_impl/graphics_3d_impl.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "gpu/command_buffer/client/gles2_cmd_helper.h" 8 #include "gpu/command_buffer/client/gles2_cmd_helper.h"
9 #include "gpu/command_buffer/client/gles2_implementation.h" 9 #include "gpu/command_buffer/client/gles2_implementation.h"
10 #include "ppapi/c/pp_errors.h" 10 #include "ppapi/c/pp_errors.h"
(...skipping 15 matching lines...) Expand all
26 int32_t Graphics3DImpl::GetAttribs(int32_t* attrib_list) { 26 int32_t Graphics3DImpl::GetAttribs(int32_t* attrib_list) {
27 // TODO(alokp): Implement me. 27 // TODO(alokp): Implement me.
28 return PP_ERROR_FAILED; 28 return PP_ERROR_FAILED;
29 } 29 }
30 30
31 int32_t Graphics3DImpl::SetAttribs(int32_t* attrib_list) { 31 int32_t Graphics3DImpl::SetAttribs(int32_t* attrib_list) {
32 // TODO(alokp): Implement me. 32 // TODO(alokp): Implement me.
33 return PP_ERROR_FAILED; 33 return PP_ERROR_FAILED;
34 } 34 }
35 35
36 int32_t Graphics3DImpl::ResizeBuffers(int32_t width, int32_t height) {
37 if ((width < 0) || (height < 0))
38 return PP_ERROR_BADARGUMENT;
39
40 gles2_impl()->ResizeCHROMIUM(width, height);
41 // TODO(alokp): Check if resize succeeded and return appropriate error code.
42 return PP_OK;
43 }
44
36 int32_t Graphics3DImpl::SwapBuffers(PP_CompletionCallback callback) { 45 int32_t Graphics3DImpl::SwapBuffers(PP_CompletionCallback callback) {
37 if (!callback.func) { 46 if (!callback.func) {
38 // Blocking SwapBuffers isn't supported (since we have to be on the main 47 // Blocking SwapBuffers isn't supported (since we have to be on the main
39 // thread). 48 // thread).
40 return PP_ERROR_BADARGUMENT; 49 return PP_ERROR_BADARGUMENT;
41 } 50 }
42 51
43 if (HasPendingSwap()) { 52 if (HasPendingSwap()) {
44 // Already a pending SwapBuffers that hasn't returned yet. 53 // Already a pending SwapBuffers that hasn't returned yet.
45 return PP_ERROR_INPROGRESS; 54 return PP_ERROR_INPROGRESS;
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 DCHECK(command_buffer); 105 DCHECK(command_buffer);
97 command_buffer->DestroyTransferBuffer(transfer_buffer_id_); 106 command_buffer->DestroyTransferBuffer(transfer_buffer_id_);
98 transfer_buffer_id_ = -1; 107 transfer_buffer_id_ = -1;
99 } 108 }
100 109
101 gles2_helper_.reset(); 110 gles2_helper_.reset();
102 } 111 }
103 112
104 } // namespace ppapi 113 } // namespace ppapi
105 114
OLDNEW
« no previous file with comments | « ppapi/shared_impl/graphics_3d_impl.h ('k') | ppapi/thunk/ppb_graphics_3d_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698