Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(155)

Side by Side Diff: content/common/gpu/media/rendering_helper.cc

Issue 367373008: rendering_helper - Unbind the thumbnail texture. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698