| 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 <string.h> | 5 #include <string.h> |
| 6 | 6 |
| 7 #include <iostream> | 7 #include <iostream> |
| 8 #include <list> | 8 #include <list> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 | 219 |
| 220 VideoDecodeDemoInstance::VideoDecodeDemoInstance(PP_Instance instance, | 220 VideoDecodeDemoInstance::VideoDecodeDemoInstance(PP_Instance instance, |
| 221 pp::Module* module) | 221 pp::Module* module) |
| 222 : pp::Instance(instance), pp::Graphics3DClient(this), | 222 : pp::Instance(instance), pp::Graphics3DClient(this), |
| 223 pp::VideoDecoderClient_Dev(this), | 223 pp::VideoDecoderClient_Dev(this), |
| 224 is_painting_(false), | 224 is_painting_(false), |
| 225 num_frames_rendered_(0), | 225 num_frames_rendered_(0), |
| 226 first_frame_delivered_ticks_(-1), | 226 first_frame_delivered_ticks_(-1), |
| 227 swap_ticks_(0), | 227 swap_ticks_(0), |
| 228 callback_factory_(this), | 228 callback_factory_(this), |
| 229 console_if_(static_cast<const PPB_Console*>( |
| 230 module->GetBrowserInterface(PPB_CONSOLE_INTERFACE))), |
| 231 core_if_(static_cast<const PPB_Core*>( |
| 232 module->GetBrowserInterface(PPB_CORE_INTERFACE))), |
| 233 gles2_if_(static_cast<const PPB_OpenGLES2*>( |
| 234 module->GetBrowserInterface(PPB_OPENGLES2_INTERFACE))), |
| 229 context_(NULL) { | 235 context_(NULL) { |
| 230 assert((console_if_ = static_cast<const PPB_Console*>( | 236 assert(console_if_); |
| 231 module->GetBrowserInterface(PPB_CONSOLE_INTERFACE)))); | 237 assert(core_if_); |
| 232 assert((core_if_ = static_cast<const PPB_Core*>( | 238 assert(gles2_if_); |
| 233 module->GetBrowserInterface(PPB_CORE_INTERFACE)))); | |
| 234 assert((gles2_if_ = static_cast<const PPB_OpenGLES2*>( | |
| 235 module->GetBrowserInterface(PPB_OPENGLES2_INTERFACE)))); | |
| 236 } | 239 } |
| 237 | 240 |
| 238 VideoDecodeDemoInstance::~VideoDecodeDemoInstance() { | 241 VideoDecodeDemoInstance::~VideoDecodeDemoInstance() { |
| 239 if (shader_2d_.program) | 242 if (shader_2d_.program) |
| 240 gles2_if_->DeleteProgram(context_->pp_resource(), shader_2d_.program); | 243 gles2_if_->DeleteProgram(context_->pp_resource(), shader_2d_.program); |
| 241 if (shader_rectangle_arb_.program) { | 244 if (shader_rectangle_arb_.program) { |
| 242 gles2_if_->DeleteProgram( | 245 gles2_if_->DeleteProgram( |
| 243 context_->pp_resource(), shader_rectangle_arb_.program); | 246 context_->pp_resource(), shader_rectangle_arb_.program); |
| 244 } | 247 } |
| 245 | 248 |
| (...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 676 gles2_if_->DeleteShader(context_->pp_resource(), shader); | 679 gles2_if_->DeleteShader(context_->pp_resource(), shader); |
| 677 } | 680 } |
| 678 } // anonymous namespace | 681 } // anonymous namespace |
| 679 | 682 |
| 680 namespace pp { | 683 namespace pp { |
| 681 // Factory function for your specialization of the Module object. | 684 // Factory function for your specialization of the Module object. |
| 682 Module* CreateModule() { | 685 Module* CreateModule() { |
| 683 return new VideoDecodeDemoModule(); | 686 return new VideoDecodeDemoModule(); |
| 684 } | 687 } |
| 685 } // namespace pp | 688 } // namespace pp |
| OLD | NEW |