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

Side by Side Diff: content/renderer/media/webmediaplayer_ms.cc

Issue 2276033002: Pass SkPaint instead of its alpha and mode in WebMediaPlayer::paint (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: better naming Created 4 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
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/renderer/media/webmediaplayer_ms.h" 5 #include "content/renderer/media/webmediaplayer_ms.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <limits> 8 #include <limits>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 return blink::WebTimeRanges(); 325 return blink::WebTimeRanges();
326 } 326 }
327 327
328 bool WebMediaPlayerMS::didLoadingProgress() { 328 bool WebMediaPlayerMS::didLoadingProgress() {
329 DCHECK(thread_checker_.CalledOnValidThread()); 329 DCHECK(thread_checker_.CalledOnValidThread());
330 return true; 330 return true;
331 } 331 }
332 332
333 void WebMediaPlayerMS::paint(blink::WebCanvas* canvas, 333 void WebMediaPlayerMS::paint(blink::WebCanvas* canvas,
334 const blink::WebRect& rect, 334 const blink::WebRect& rect,
335 unsigned char alpha, 335 SkPaint& paint) {
336 SkXfermode::Mode mode) {
337 DVLOG(3) << __func__; 336 DVLOG(3) << __func__;
338 DCHECK(thread_checker_.CalledOnValidThread()); 337 DCHECK(thread_checker_.CalledOnValidThread());
339 338
340 const scoped_refptr<media::VideoFrame> frame = 339 const scoped_refptr<media::VideoFrame> frame =
341 compositor_->GetCurrentFrameWithoutUpdatingStatistics(); 340 compositor_->GetCurrentFrameWithoutUpdatingStatistics();
342 341
343 media::Context3D context_3d; 342 media::Context3D context_3d;
344 if (frame && frame->HasTextures()) { 343 if (frame && frame->HasTextures()) {
345 auto* provider = 344 auto* provider =
346 RenderThreadImpl::current()->SharedMainThreadContextProvider().get(); 345 RenderThreadImpl::current()->SharedMainThreadContextProvider().get();
347 // GPU Process crashed. 346 // GPU Process crashed.
348 if (!provider) 347 if (!provider)
349 return; 348 return;
350 context_3d = media::Context3D(provider->ContextGL(), provider->GrContext()); 349 context_3d = media::Context3D(provider->ContextGL(), provider->GrContext());
351 DCHECK(context_3d.gl); 350 DCHECK(context_3d.gl);
352 } 351 }
353 const gfx::RectF dest_rect(rect.x, rect.y, rect.width, rect.height); 352 const gfx::RectF dest_rect(rect.x, rect.y, rect.width, rect.height);
354 video_renderer_.Paint(frame, canvas, dest_rect, alpha, mode, 353 video_renderer_.Paint(frame, canvas, dest_rect, paint,
355 video_rotation_, context_3d); 354 video_rotation_, context_3d);
356 } 355 }
357 356
358 bool WebMediaPlayerMS::hasSingleSecurityOrigin() const { 357 bool WebMediaPlayerMS::hasSingleSecurityOrigin() const {
359 DCHECK(thread_checker_.CalledOnValidThread()); 358 DCHECK(thread_checker_.CalledOnValidThread());
360 return true; 359 return true;
361 } 360 }
362 361
363 bool WebMediaPlayerMS::didPassCORSAccessCheck() const { 362 bool WebMediaPlayerMS::didPassCORSAccessCheck() const {
364 DCHECK(thread_checker_.CalledOnValidThread()); 363 DCHECK(thread_checker_.CalledOnValidThread());
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 void WebMediaPlayerMS::ResetCanvasCache() { 550 void WebMediaPlayerMS::ResetCanvasCache() {
552 DCHECK(thread_checker_.CalledOnValidThread()); 551 DCHECK(thread_checker_.CalledOnValidThread());
553 video_renderer_.ResetCache(); 552 video_renderer_.ResetCache();
554 } 553 }
555 554
556 void WebMediaPlayerMS::TriggerResize() { 555 void WebMediaPlayerMS::TriggerResize() {
557 get_client()->sizeChanged(); 556 get_client()->sizeChanged();
558 } 557 }
559 558
560 } // namespace content 559 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698