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

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

Issue 10909244: PPAPI: Get TrackedCallback ready for running on non-main threads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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
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 "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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 return gles2_impl_->MapTexSubImage2DCHROMIUM( 78 return gles2_impl_->MapTexSubImage2DCHROMIUM(
79 target, level, xoffset, yoffset, width, height, format, type, access); 79 target, level, xoffset, yoffset, width, height, format, type, access);
80 } 80 }
81 81
82 void PPB_Graphics3D_Shared::UnmapTexSubImage2DCHROMIUM(const void* mem) { 82 void PPB_Graphics3D_Shared::UnmapTexSubImage2DCHROMIUM(const void* mem) {
83 gles2_impl_->UnmapTexSubImage2DCHROMIUM(mem); 83 gles2_impl_->UnmapTexSubImage2DCHROMIUM(mem);
84 } 84 }
85 85
86 void PPB_Graphics3D_Shared::SwapBuffersACK(int32_t pp_error) { 86 void PPB_Graphics3D_Shared::SwapBuffersACK(int32_t pp_error) {
87 DCHECK(HasPendingSwap()); 87 DCHECK(HasPendingSwap());
88 TrackedCallback::ClearAndRun(&swap_callback_, pp_error); 88 swap_callback_->Run(pp_error);
89 } 89 }
90 90
91 bool PPB_Graphics3D_Shared::HasPendingSwap() const { 91 bool PPB_Graphics3D_Shared::HasPendingSwap() const {
92 return TrackedCallback::IsPending(swap_callback_); 92 return TrackedCallback::IsPending(swap_callback_);
93 } 93 }
94 94
95 bool PPB_Graphics3D_Shared::CreateGLES2Impl( 95 bool PPB_Graphics3D_Shared::CreateGLES2Impl(
96 int32 command_buffer_size, 96 int32 command_buffer_size,
97 int32 transfer_buffer_size, 97 int32 transfer_buffer_size,
98 gpu::gles2::GLES2Implementation* share_gles2) { 98 gpu::gles2::GLES2Implementation* share_gles2) {
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 } 131 }
132 132
133 void PPB_Graphics3D_Shared::DestroyGLES2Impl() { 133 void PPB_Graphics3D_Shared::DestroyGLES2Impl() {
134 gles2_impl_.reset(); 134 gles2_impl_.reset();
135 transfer_buffer_.reset(); 135 transfer_buffer_.reset();
136 gles2_helper_.reset(); 136 gles2_helper_.reset();
137 } 137 }
138 138
139 } // namespace ppapi 139 } // namespace ppapi
140 140
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698