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

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

Issue 552273004: Remove implicit conversions from scoped_refptr to T* in content/common/gpu (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 XStoreName(display, window_, "VideoDecodeAcceleratorTest"); 164 XStoreName(display, window_, "VideoDecodeAcceleratorTest");
165 XSelectInput(display, window_, ExposureMask); 165 XSelectInput(display, window_, ExposureMask);
166 XMapWindow(display, window_); 166 XMapWindow(display, window_);
167 #else 167 #else
168 #error unknown platform 168 #error unknown platform
169 #endif 169 #endif
170 CHECK(window_ != gfx::kNullAcceleratedWidget); 170 CHECK(window_ != gfx::kNullAcceleratedWidget);
171 171
172 gl_surface_ = gfx::GLSurface::CreateViewGLSurface(window_); 172 gl_surface_ = gfx::GLSurface::CreateViewGLSurface(window_);
173 gl_context_ = gfx::GLContext::CreateGLContext( 173 gl_context_ = gfx::GLContext::CreateGLContext(
174 NULL, gl_surface_, gfx::PreferIntegratedGpu); 174 NULL, gl_surface_.get(), gfx::PreferIntegratedGpu);
175 gl_context_->MakeCurrent(gl_surface_); 175 gl_context_->MakeCurrent(gl_surface_.get());
176 176
177 CHECK_GT(params.window_sizes.size(), 0U); 177 CHECK_GT(params.window_sizes.size(), 0U);
178 videos_.resize(params.window_sizes.size()); 178 videos_.resize(params.window_sizes.size());
179 LayoutRenderingAreas(params.window_sizes); 179 LayoutRenderingAreas(params.window_sizes);
180 180
181 if (render_as_thumbnails_) { 181 if (render_as_thumbnails_) {
182 CHECK_EQ(videos_.size(), 1U); 182 CHECK_EQ(videos_.size(), 1U);
183 183
184 GLint max_texture_size; 184 GLint max_texture_size;
185 glGetIntegerv(GL_MAX_TEXTURE_SIZE, &max_texture_size); 185 glGetIntegerv(GL_MAX_TEXTURE_SIZE, &max_texture_size);
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 CHECK_EQ(base::MessageLoop::current(), message_loop_); 310 CHECK_EQ(base::MessageLoop::current(), message_loop_);
311 311
312 // Deletion will also stop the timer. 312 // Deletion will also stop the timer.
313 render_timer_.reset(); 313 render_timer_.reset();
314 314
315 if (render_as_thumbnails_) { 315 if (render_as_thumbnails_) {
316 glDeleteTextures(1, &thumbnails_texture_id_); 316 glDeleteTextures(1, &thumbnails_texture_id_);
317 glDeleteFramebuffersEXT(1, &thumbnails_fbo_id_); 317 glDeleteFramebuffersEXT(1, &thumbnails_fbo_id_);
318 } 318 }
319 319
320 gl_context_->ReleaseCurrent(gl_surface_); 320 gl_context_->ReleaseCurrent(gl_surface_.get());
321 gl_context_ = NULL; 321 gl_context_ = NULL;
322 gl_surface_ = NULL; 322 gl_surface_ = NULL;
323 323
324 Clear(); 324 Clear();
325 done->Signal(); 325 done->Signal();
326 } 326 }
327 327
328 void RenderingHelper::CreateTexture(uint32 texture_target, 328 void RenderingHelper::CreateTexture(uint32 texture_target,
329 uint32* texture_id, 329 uint32* texture_id,
330 const gfx::Size& size, 330 const gfx::Size& size,
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
585 scale = std::min(1.0f, scale); 585 scale = std::min(1.0f, scale);
586 586
587 size_t w = scale * size.width(); 587 size_t w = scale * size.width();
588 size_t h = scale * size.height(); 588 size_t h = scale * size.height();
589 size_t x = offset_x[i % cols] + (widths[i % cols] - w) / 2; 589 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; 590 size_t y = offset_y[i / cols] + (heights[i / cols] - h) / 2;
591 videos_[i].render_area = gfx::Rect(x, y, w, h); 591 videos_[i].render_area = gfx::Rect(x, y, w, h);
592 } 592 }
593 } 593 }
594 } // namespace content 594 } // 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