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 <algorithm> | 9 #include <algorithm> |
10 #include <utility> | 10 #include <utility> |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 void PepperVideoRenderer3D::OnViewChanged(const pp::View& view) { | 100 void PepperVideoRenderer3D::OnViewChanged(const pp::View& view) { |
101 fallback_renderer_.OnViewChanged(view); | 101 fallback_renderer_.OnViewChanged(view); |
102 | 102 |
103 pp::Size size = view.GetRect().size(); | 103 pp::Size size = view.GetRect().size(); |
104 float scale = view.GetDeviceScale(); | 104 float scale = view.GetDeviceScale(); |
105 DCHECK_GT(scale, 0.0); | 105 DCHECK_GT(scale, 0.0); |
106 view_size_.set(std::min<int>(ceilf(size.width() * scale), | 106 view_size_.set(std::min<int>(ceilf(size.width() * scale), |
107 gl_max_viewport_size_[0]), | 107 gl_max_viewport_size_[0]), |
108 std::min<int>(ceilf(size.height() * scale), | 108 std::min<int>(ceilf(size.height() * scale), |
109 gl_max_viewport_size_[1])); | 109 gl_max_viewport_size_[1])); |
110 graphics_.ResizeBuffers(view_size_.width(), view_size_.height()); | 110 graphics_.ResizeBuffers(size.width(), size.height()); |
111 | 111 |
112 force_repaint_ = true; | 112 force_repaint_ = true; |
113 PaintIfNeeded(); | 113 PaintIfNeeded(); |
114 } | 114 } |
115 | 115 |
116 void PepperVideoRenderer3D::EnableDebugDirtyRegion(bool enable) { | 116 void PepperVideoRenderer3D::EnableDebugDirtyRegion(bool enable) { |
117 fallback_renderer_.EnableDebugDirtyRegion(enable); | 117 fallback_renderer_.EnableDebugDirtyRegion(enable); |
118 debug_dirty_region_ = enable; | 118 debug_dirty_region_ = enable; |
119 } | 119 } |
120 | 120 |
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
573 gles2_if_->AttachShader(graphics_.pp_resource(), shader_program_, shader); | 573 gles2_if_->AttachShader(graphics_.pp_resource(), shader_program_, shader); |
574 gles2_if_->DeleteShader(graphics_.pp_resource(), shader); | 574 gles2_if_->DeleteShader(graphics_.pp_resource(), shader); |
575 } | 575 } |
576 | 576 |
577 void PepperVideoRenderer3D::CheckGLError() { | 577 void PepperVideoRenderer3D::CheckGLError() { |
578 GLenum error = gles2_if_->GetError(graphics_.pp_resource()); | 578 GLenum error = gles2_if_->GetError(graphics_.pp_resource()); |
579 CHECK_EQ(error, static_cast<GLenum>(GL_NO_ERROR)) << "GL error: " << error; | 579 CHECK_EQ(error, static_cast<GLenum>(GL_NO_ERROR)) << "GL error: " << error; |
580 } | 580 } |
581 | 581 |
582 } // namespace remoting | 582 } // namespace remoting |
OLD | NEW |