| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/common/gpu/media/rendering_helper.h" | 5 #include "content/common/gpu/media/rendering_helper.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <numeric> | 8 #include <numeric> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 423 glBindTexture(texture_target, 0); | 423 glBindTexture(texture_target, 0); |
| 424 CHECK_EQ(static_cast<int>(glGetError()), GL_NO_ERROR); | 424 CHECK_EQ(static_cast<int>(glGetError()), GL_NO_ERROR); |
| 425 } | 425 } |
| 426 | 426 |
| 427 void RenderingHelper::DeleteTexture(uint32 texture_id) { | 427 void RenderingHelper::DeleteTexture(uint32 texture_id) { |
| 428 CHECK_EQ(base::MessageLoop::current(), message_loop_); | 428 CHECK_EQ(base::MessageLoop::current(), message_loop_); |
| 429 glDeleteTextures(1, &texture_id); | 429 glDeleteTextures(1, &texture_id); |
| 430 CHECK_EQ(static_cast<int>(glGetError()), GL_NO_ERROR); | 430 CHECK_EQ(static_cast<int>(glGetError()), GL_NO_ERROR); |
| 431 } | 431 } |
| 432 | 432 |
| 433 void* RenderingHelper::GetGLContext() { | 433 gfx::GLContext* RenderingHelper::GetGLContext() { |
| 434 return gl_context_.get(); |
| 435 } |
| 436 |
| 437 void* RenderingHelper::GetGLContextHandle() { |
| 434 return gl_context_->GetHandle(); | 438 return gl_context_->GetHandle(); |
| 435 } | 439 } |
| 436 | 440 |
| 437 void* RenderingHelper::GetGLDisplay() { | 441 void* RenderingHelper::GetGLDisplay() { |
| 438 return gl_surface_->GetDisplay(); | 442 return gl_surface_->GetDisplay(); |
| 439 } | 443 } |
| 440 | 444 |
| 441 void RenderingHelper::Clear() { | 445 void RenderingHelper::Clear() { |
| 442 videos_.clear(); | 446 videos_.clear(); |
| 443 message_loop_ = NULL; | 447 message_loop_ = NULL; |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 585 scale = std::min(1.0f, scale); | 589 scale = std::min(1.0f, scale); |
| 586 | 590 |
| 587 size_t w = scale * size.width(); | 591 size_t w = scale * size.width(); |
| 588 size_t h = scale * size.height(); | 592 size_t h = scale * size.height(); |
| 589 size_t x = offset_x[i % cols] + (widths[i % cols] - w) / 2; | 593 size_t x = offset_x[i % cols] + (widths[i % cols] - w) / 2; |
| 590 size_t y = offset_y[i / cols] + (heights[i / cols] - h) / 2; | 594 size_t y = offset_y[i / cols] + (heights[i / cols] - h) / 2; |
| 591 videos_[i].render_area = gfx::Rect(x, y, w, h); | 595 videos_[i].render_area = gfx::Rect(x, y, w, h); |
| 592 } | 596 } |
| 593 } | 597 } |
| 594 } // namespace content | 598 } // namespace content |
| OLD | NEW |