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

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: android should compile 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
« no previous file with comments | « content/renderer/media/webmediaplayer_ms.h ('k') | media/blink/webmediaplayer_impl.h » ('j') | 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/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 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 return blink::WebTimeRanges(); 326 return blink::WebTimeRanges();
327 } 327 }
328 328
329 bool WebMediaPlayerMS::didLoadingProgress() { 329 bool WebMediaPlayerMS::didLoadingProgress() {
330 DCHECK(thread_checker_.CalledOnValidThread()); 330 DCHECK(thread_checker_.CalledOnValidThread());
331 return true; 331 return true;
332 } 332 }
333 333
334 void WebMediaPlayerMS::paint(blink::WebCanvas* canvas, 334 void WebMediaPlayerMS::paint(blink::WebCanvas* canvas,
335 const blink::WebRect& rect, 335 const blink::WebRect& rect,
336 unsigned char alpha, 336 SkPaint& paint) {
337 SkXfermode::Mode mode) {
338 DVLOG(3) << __func__; 337 DVLOG(3) << __func__;
339 DCHECK(thread_checker_.CalledOnValidThread()); 338 DCHECK(thread_checker_.CalledOnValidThread());
340 339
341 const scoped_refptr<media::VideoFrame> frame = 340 const scoped_refptr<media::VideoFrame> frame =
342 compositor_->GetCurrentFrameWithoutUpdatingStatistics(); 341 compositor_->GetCurrentFrameWithoutUpdatingStatistics();
343 342
344 media::Context3D context_3d; 343 media::Context3D context_3d;
345 if (frame && frame->HasTextures()) { 344 if (frame && frame->HasTextures()) {
346 auto* provider = 345 auto* provider =
347 RenderThreadImpl::current()->SharedMainThreadContextProvider().get(); 346 RenderThreadImpl::current()->SharedMainThreadContextProvider().get();
348 // GPU Process crashed. 347 // GPU Process crashed.
349 if (!provider) 348 if (!provider)
350 return; 349 return;
351 context_3d = media::Context3D(provider->ContextGL(), provider->GrContext()); 350 context_3d = media::Context3D(provider->ContextGL(), provider->GrContext());
352 DCHECK(context_3d.gl); 351 DCHECK(context_3d.gl);
353 } 352 }
354 const gfx::RectF dest_rect(rect.x, rect.y, rect.width, rect.height); 353 const gfx::RectF dest_rect(rect.x, rect.y, rect.width, rect.height);
355 video_renderer_.Paint(frame, canvas, dest_rect, alpha, mode, 354 video_renderer_.Paint(frame, canvas, dest_rect, paint,
356 video_rotation_, context_3d); 355 video_rotation_, context_3d);
357 } 356 }
358 357
359 bool WebMediaPlayerMS::hasSingleSecurityOrigin() const { 358 bool WebMediaPlayerMS::hasSingleSecurityOrigin() const {
360 DCHECK(thread_checker_.CalledOnValidThread()); 359 DCHECK(thread_checker_.CalledOnValidThread());
361 return true; 360 return true;
362 } 361 }
363 362
364 bool WebMediaPlayerMS::didPassCORSAccessCheck() const { 363 bool WebMediaPlayerMS::didPassCORSAccessCheck() const {
365 DCHECK(thread_checker_.CalledOnValidThread()); 364 DCHECK(thread_checker_.CalledOnValidThread());
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 void WebMediaPlayerMS::ResetCanvasCache() { 551 void WebMediaPlayerMS::ResetCanvasCache() {
553 DCHECK(thread_checker_.CalledOnValidThread()); 552 DCHECK(thread_checker_.CalledOnValidThread());
554 video_renderer_.ResetCache(); 553 video_renderer_.ResetCache();
555 } 554 }
556 555
557 void WebMediaPlayerMS::TriggerResize() { 556 void WebMediaPlayerMS::TriggerResize() {
558 get_client()->sizeChanged(); 557 get_client()->sizeChanged();
559 } 558 }
560 559
561 } // namespace content 560 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/webmediaplayer_ms.h ('k') | media/blink/webmediaplayer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698