OLD | NEW |
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 "ppapi/shared_impl/ppb_graphics_3d_shared.h" | 5 #include "ppapi/shared_impl/ppb_graphics_3d_shared.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 "gpu/command_buffer/client/transfer_buffer.h" | 10 #include "gpu/command_buffer/client/transfer_buffer.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 | 41 |
42 int32_t PPB_Graphics3D_Shared::GetError() { | 42 int32_t PPB_Graphics3D_Shared::GetError() { |
43 // TODO(alokp): Implement me. | 43 // TODO(alokp): Implement me. |
44 return PP_ERROR_FAILED; | 44 return PP_ERROR_FAILED; |
45 } | 45 } |
46 | 46 |
47 int32_t PPB_Graphics3D_Shared::ResizeBuffers(int32_t width, int32_t height) { | 47 int32_t PPB_Graphics3D_Shared::ResizeBuffers(int32_t width, int32_t height) { |
48 if ((width < 0) || (height < 0)) | 48 if ((width < 0) || (height < 0)) |
49 return PP_ERROR_BADARGUMENT; | 49 return PP_ERROR_BADARGUMENT; |
50 | 50 |
51 gles2_impl()->ResizeCHROMIUM(width, height, 1.f); | 51 gles2_impl()->ResizeCHROMIUM(width, height, 1.f, true); |
52 // TODO(alokp): Check if resize succeeded and return appropriate error code. | 52 // TODO(alokp): Check if resize succeeded and return appropriate error code. |
53 return PP_OK; | 53 return PP_OK; |
54 } | 54 } |
55 | 55 |
56 int32_t PPB_Graphics3D_Shared::SwapBuffers( | 56 int32_t PPB_Graphics3D_Shared::SwapBuffers( |
57 scoped_refptr<TrackedCallback> callback) { | 57 scoped_refptr<TrackedCallback> callback) { |
58 if (HasPendingSwap()) { | 58 if (HasPendingSwap()) { |
59 Log(PP_LOGLEVEL_ERROR, | 59 Log(PP_LOGLEVEL_ERROR, |
60 "PPB_Graphics3D.SwapBuffers: Plugin attempted swap " | 60 "PPB_Graphics3D.SwapBuffers: Plugin attempted swap " |
61 "with previous swap still pending."); | 61 "with previous swap still pending."); |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 return true; | 144 return true; |
145 } | 145 } |
146 | 146 |
147 void PPB_Graphics3D_Shared::DestroyGLES2Impl() { | 147 void PPB_Graphics3D_Shared::DestroyGLES2Impl() { |
148 gles2_impl_.reset(); | 148 gles2_impl_.reset(); |
149 transfer_buffer_.reset(); | 149 transfer_buffer_.reset(); |
150 gles2_helper_.reset(); | 150 gles2_helper_.reset(); |
151 } | 151 } |
152 | 152 |
153 } // namespace ppapi | 153 } // namespace ppapi |
OLD | NEW |