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

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

Issue 8316008: Add a new globals object for PPAPI tracking information. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 2 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) 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/video_decoder_impl.h" 5 #include "ppapi/shared_impl/video_decoder_impl.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "gpu/command_buffer/client/gles2_implementation.h" 8 #include "gpu/command_buffer/client/gles2_implementation.h"
9 #include "ppapi/c/pp_errors.h" 9 #include "ppapi/c/pp_errors.h"
10 #include "ppapi/proxy/plugin_resource_tracker.h" 10 #include "ppapi/proxy/plugin_resource_tracker.h"
(...skipping 14 matching lines...) Expand all
25 25
26 VideoDecoderImpl::~VideoDecoderImpl() { 26 VideoDecoderImpl::~VideoDecoderImpl() {
27 } 27 }
28 28
29 void VideoDecoderImpl::InitCommon( 29 void VideoDecoderImpl::InitCommon(
30 PP_Resource graphics_context, 30 PP_Resource graphics_context,
31 gpu::gles2::GLES2Implementation* gles2_impl) { 31 gpu::gles2::GLES2Implementation* gles2_impl) {
32 DCHECK(graphics_context); 32 DCHECK(graphics_context);
33 DCHECK(!gles2_impl_ && !graphics_context_); 33 DCHECK(!gles2_impl_ && !graphics_context_);
34 gles2_impl_ = gles2_impl; 34 gles2_impl_ = gles2_impl;
35 TrackerBase::Get()->GetResourceTracker()->AddRefResource(graphics_context); 35 PpapiGlobals::Get()->GetResourceTracker()->AddRefResource(graphics_context);
36 graphics_context_ = graphics_context; 36 graphics_context_ = graphics_context;
37 } 37 }
38 38
39 void VideoDecoderImpl::Destroy() { 39 void VideoDecoderImpl::Destroy() {
40 graphics_context_ = 0; 40 graphics_context_ = 0;
41 gles2_impl_ = NULL; 41 gles2_impl_ = NULL;
42 TrackerBase::Get()->GetResourceTracker()->ReleaseResource(graphics_context_); 42 PpapiGlobals::Get()->GetResourceTracker()->ReleaseResource(graphics_context_);
43 } 43 }
44 44
45 bool VideoDecoderImpl::SetFlushCallback(PP_CompletionCallback callback) { 45 bool VideoDecoderImpl::SetFlushCallback(PP_CompletionCallback callback) {
46 CHECK(callback.func); 46 CHECK(callback.func);
47 if (flush_callback_.func) 47 if (flush_callback_.func)
48 return false; 48 return false;
49 flush_callback_ = callback; 49 flush_callback_ = callback;
50 return true; 50 return true;
51 } 51 }
52 52
(...skipping 30 matching lines...) Expand all
83 bitstream_buffer_callbacks_.erase(it); 83 bitstream_buffer_callbacks_.erase(it);
84 PP_RunCompletionCallback(&cc, PP_OK); 84 PP_RunCompletionCallback(&cc, PP_OK);
85 } 85 }
86 86
87 void VideoDecoderImpl::FlushCommandBuffer() { 87 void VideoDecoderImpl::FlushCommandBuffer() {
88 if (gles2_impl_) 88 if (gles2_impl_)
89 gles2_impl_->Flush(); 89 gles2_impl_->Flush();
90 } 90 }
91 91
92 } // namespace ppapi 92 } // namespace ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698