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

Side by Side Diff: media/filters/skcanvas_video_renderer.cc

Issue 802343009: Allow rectangle textures to be copied with Y flipped. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "media/filters/skcanvas_video_renderer.h" 5 #include "media/filters/skcanvas_video_renderer.h"
6 6
7 #include "gpu/GLES2/gl2extchromium.h" 7 #include "gpu/GLES2/gl2extchromium.h"
8 #include "gpu/command_buffer/client/gles2_interface.h" 8 #include "gpu/command_buffer/client/gles2_interface.h"
9 #include "gpu/command_buffer/common/mailbox_holder.h" 9 #include "gpu/command_buffer/common/mailbox_holder.h"
10 #include "media/base/video_frame.h" 10 #include "media/base/video_frame.h"
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 VideoFrame* video_frame, 553 VideoFrame* video_frame,
554 unsigned int texture, 554 unsigned int texture,
555 unsigned int level, 555 unsigned int level,
556 unsigned int internal_format, 556 unsigned int internal_format,
557 unsigned int type, 557 unsigned int type,
558 bool premultiply_alpha, 558 bool premultiply_alpha,
559 bool flip_y) { 559 bool flip_y) {
560 DCHECK(video_frame && video_frame->format() == VideoFrame::NATIVE_TEXTURE); 560 DCHECK(video_frame && video_frame->format() == VideoFrame::NATIVE_TEXTURE);
561 const gpu::MailboxHolder* mailbox_holder = video_frame->mailbox_holder(); 561 const gpu::MailboxHolder* mailbox_holder = video_frame->mailbox_holder();
562 DCHECK(mailbox_holder->texture_target == GL_TEXTURE_2D || 562 DCHECK(mailbox_holder->texture_target == GL_TEXTURE_2D ||
563 mailbox_holder->texture_target == GL_TEXTURE_RECTANGLE_ARB ||
563 mailbox_holder->texture_target == GL_TEXTURE_EXTERNAL_OES); 564 mailbox_holder->texture_target == GL_TEXTURE_EXTERNAL_OES);
564 565
565 gl->WaitSyncPointCHROMIUM(mailbox_holder->sync_point); 566 gl->WaitSyncPointCHROMIUM(mailbox_holder->sync_point);
566 uint32 source_texture = gl->CreateAndConsumeTextureCHROMIUM( 567 uint32 source_texture = gl->CreateAndConsumeTextureCHROMIUM(
567 mailbox_holder->texture_target, mailbox_holder->mailbox.name); 568 mailbox_holder->texture_target, mailbox_holder->mailbox.name);
568 569
569 // The video is stored in a unmultiplied format, so premultiply 570 // The video is stored in a unmultiplied format, so premultiply
570 // if necessary. 571 // if necessary.
571 gl->PixelStorei(GL_UNPACK_PREMULTIPLY_ALPHA_CHROMIUM, premultiply_alpha); 572 gl->PixelStorei(GL_UNPACK_PREMULTIPLY_ALPHA_CHROMIUM, premultiply_alpha);
572 // Application itself needs to take care of setting the right |flip_y| 573 // Application itself needs to take care of setting the right |flip_y|
(...skipping 18 matching lines...) Expand all
591 last_frame_timestamp_ = media::kNoTimestamp(); 592 last_frame_timestamp_ = media::kNoTimestamp();
592 } 593 }
593 594
594 void SkCanvasVideoRenderer::ResetAcceleratedLastFrame() { 595 void SkCanvasVideoRenderer::ResetAcceleratedLastFrame() {
595 accelerated_last_frame_.reset(); 596 accelerated_last_frame_.reset();
596 accelerated_generator_ = nullptr; 597 accelerated_generator_ = nullptr;
597 accelerated_last_frame_timestamp_ = media::kNoTimestamp(); 598 accelerated_last_frame_timestamp_ = media::kNoTimestamp();
598 } 599 }
599 600
600 } // namespace media 601 } // namespace media
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