| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "remoting/client/plugin/pepper_video_renderer_3d.h" | 5 #include "remoting/client/plugin/pepper_video_renderer_3d.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 | 8 |
| 9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 graphics_, video_profile, PP_HARDWAREACCELERATION_WITHFALLBACK, | 170 graphics_, video_profile, PP_HARDWAREACCELERATION_WITHFALLBACK, |
| 171 callback_factory_.NewCallback(&PepperVideoRenderer3D::OnInitialized)); | 171 callback_factory_.NewCallback(&PepperVideoRenderer3D::OnInitialized)); |
| 172 CHECK_EQ(result, PP_OK_COMPLETIONPENDING) | 172 CHECK_EQ(result, PP_OK_COMPLETIONPENDING) |
| 173 << "video_decoder_.Initialize() returned " << result; | 173 << "video_decoder_.Initialize() returned " << result; |
| 174 } | 174 } |
| 175 | 175 |
| 176 ChromotingStats* PepperVideoRenderer3D::GetStats() { | 176 ChromotingStats* PepperVideoRenderer3D::GetStats() { |
| 177 return &stats_; | 177 return &stats_; |
| 178 } | 178 } |
| 179 | 179 |
| 180 protocol::VideoStub* PepperVideoRenderer3D::GetVideoStub() { |
| 181 return this; |
| 182 } |
| 183 |
| 180 void PepperVideoRenderer3D::ProcessVideoPacket(scoped_ptr<VideoPacket> packet, | 184 void PepperVideoRenderer3D::ProcessVideoPacket(scoped_ptr<VideoPacket> packet, |
| 181 const base::Closure& done) { | 185 const base::Closure& done) { |
| 182 base::ScopedClosureRunner done_runner(done); | 186 base::ScopedClosureRunner done_runner(done); |
| 183 | 187 |
| 184 // Don't need to do anything if the packet is empty. Host sends empty video | 188 // Don't need to do anything if the packet is empty. Host sends empty video |
| 185 // packets when the screen is not changing. | 189 // packets when the screen is not changing. |
| 186 if (!packet->data().size()) | 190 if (!packet->data().size()) |
| 187 return; | 191 return; |
| 188 | 192 |
| 189 // Update statistics. | 193 // Update statistics. |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 508 gles2_if_->AttachShader(graphics_.pp_resource(), shader_program_, shader); | 512 gles2_if_->AttachShader(graphics_.pp_resource(), shader_program_, shader); |
| 509 gles2_if_->DeleteShader(graphics_.pp_resource(), shader); | 513 gles2_if_->DeleteShader(graphics_.pp_resource(), shader); |
| 510 } | 514 } |
| 511 | 515 |
| 512 void PepperVideoRenderer3D::CheckGLError() { | 516 void PepperVideoRenderer3D::CheckGLError() { |
| 513 GLenum error = gles2_if_->GetError(graphics_.pp_resource()); | 517 GLenum error = gles2_if_->GetError(graphics_.pp_resource()); |
| 514 CHECK_EQ(error, static_cast<GLenum>(GL_NO_ERROR)) << "GL error: " << error; | 518 CHECK_EQ(error, static_cast<GLenum>(GL_NO_ERROR)) << "GL error: " << error; |
| 515 } | 519 } |
| 516 | 520 |
| 517 } // namespace remoting | 521 } // namespace remoting |
| OLD | NEW |