| 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 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 thumbnails_fbo_size_.width(), | 268 thumbnails_fbo_size_.width(), |
| 269 thumbnails_fbo_size_.height(), | 269 thumbnails_fbo_size_.height(), |
| 270 0, | 270 0, |
| 271 GL_RGB, | 271 GL_RGB, |
| 272 GL_UNSIGNED_SHORT_5_6_5, | 272 GL_UNSIGNED_SHORT_5_6_5, |
| 273 NULL); | 273 NULL); |
| 274 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); | 274 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); |
| 275 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); | 275 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); |
| 276 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); | 276 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); |
| 277 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); | 277 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); |
| 278 glBindTexture(GL_TEXTURE_2D, 0); |
| 278 | 279 |
| 279 glBindFramebufferEXT(GL_FRAMEBUFFER, thumbnails_fbo_id_); | 280 glBindFramebufferEXT(GL_FRAMEBUFFER, thumbnails_fbo_id_); |
| 280 glFramebufferTexture2DEXT(GL_FRAMEBUFFER, | 281 glFramebufferTexture2DEXT(GL_FRAMEBUFFER, |
| 281 GL_COLOR_ATTACHMENT0, | 282 GL_COLOR_ATTACHMENT0, |
| 282 GL_TEXTURE_2D, | 283 GL_TEXTURE_2D, |
| 283 thumbnails_texture_id_, | 284 thumbnails_texture_id_, |
| 284 0); | 285 0); |
| 285 | 286 |
| 286 GLenum fb_status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER); | 287 GLenum fb_status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER); |
| 287 CHECK(fb_status == GL_FRAMEBUFFER_COMPLETE) << fb_status; | 288 CHECK(fb_status == GL_FRAMEBUFFER_COMPLETE) << fb_status; |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 631 scale = std::min(1.0f, scale); | 632 scale = std::min(1.0f, scale); |
| 632 | 633 |
| 633 size_t w = scale * window_size.width(); | 634 size_t w = scale * window_size.width(); |
| 634 size_t h = scale * window_size.height(); | 635 size_t h = scale * window_size.height(); |
| 635 size_t x = offset_x[i % cols] + (widths[i % cols] - w) / 2; | 636 size_t x = offset_x[i % cols] + (widths[i % cols] - w) / 2; |
| 636 size_t y = offset_y[i / cols] + (heights[i / cols] - h) / 2; | 637 size_t y = offset_y[i / cols] + (heights[i / cols] - h) / 2; |
| 637 render_areas_.push_back(gfx::Rect(x, y, w, h)); | 638 render_areas_.push_back(gfx::Rect(x, y, w, h)); |
| 638 } | 639 } |
| 639 } | 640 } |
| 640 } // namespace content | 641 } // namespace content |
| OLD | NEW |