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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLVideoElement.cpp

Issue 1413833006: Reland of "webgl: optimize webgl.texSubImage2D(video) path." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add TODO comments Created 5 years, 1 month 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 /* 1 /*
2 * Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 return; 199 return;
200 200
201 SkXfermode::Mode mode; 201 SkXfermode::Mode mode;
202 if (!paint || !SkXfermode::AsMode(paint->getXfermode(), &mode)) 202 if (!paint || !SkXfermode::AsMode(paint->getXfermode(), &mode))
203 mode = SkXfermode::kSrcOver_Mode; 203 mode = SkXfermode::kSrcOver_Mode;
204 204
205 // TODO(junov, philipj): crbug.com/456529 Pass the whole SkPaint instead of only alpha and xfermode 205 // TODO(junov, philipj): crbug.com/456529 Pass the whole SkPaint instead of only alpha and xfermode
206 webMediaPlayer()->paint(canvas, destRect, paint ? paint->getAlpha() : 0xFF, mode); 206 webMediaPlayer()->paint(canvas, destRect, paint ? paint->getAlpha() : 0xFF, mode);
207 } 207 }
208 208
209 bool HTMLVideoElement::copyVideoTextureToPlatformTexture(WebGraphicsContext3D* c ontext, Platform3DObject texture, GLenum internalFormat, GLenum type, bool premu ltiplyAlpha, bool flipY) 209 bool HTMLVideoElement::copyVideoTextureToPlatformTexture(WebGraphicsContext3D* c ontext, const WebMediaPlayer::CopyVideoTextureParams& params)
210 { 210 {
211 if (!webMediaPlayer()) 211 if (!webMediaPlayer())
212 return false; 212 return false;
213 213
214 ASSERT(Extensions3DUtil::canUseCopyTextureCHROMIUM(GL_TEXTURE_2D, internalFo rmat, type, 0)); 214 ASSERT(Extensions3DUtil::canUseCopyTextureCHROMIUM(params.target,
215 return webMediaPlayer()->copyVideoTextureToPlatformTexture(context, texture, internalFormat, type, premultiplyAlpha, flipY); 215 params.copyType == WebMediaPlayer::CopyVideoTextureParams::SubCopy ? GL_ RGBA : params.internalFormat,
216 params.copyType == WebMediaPlayer::CopyVideoTextureParams::SubCopy ? GL_ UNSIGNED_BYTE : params.type,
217 params.level));
218 return webMediaPlayer()->copyVideoTextureToPlatformTexture(context, params);
216 } 219 }
217 220
218 bool HTMLVideoElement::hasAvailableVideoFrame() const 221 bool HTMLVideoElement::hasAvailableVideoFrame() const
219 { 222 {
220 if (!webMediaPlayer()) 223 if (!webMediaPlayer())
221 return false; 224 return false;
222 225
223 return webMediaPlayer()->hasVideo() && webMediaPlayer()->readyState() >= Web MediaPlayer::ReadyStateHaveCurrentData; 226 return webMediaPlayer()->hasVideo() && webMediaPlayer()->readyState() >= Web MediaPlayer::ReadyStateHaveCurrentData;
224 } 227 }
225 228
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 { 317 {
315 return !isMediaDataCORSSameOrigin(destinationSecurityOrigin); 318 return !isMediaDataCORSSameOrigin(destinationSecurityOrigin);
316 } 319 }
317 320
318 FloatSize HTMLVideoElement::elementSize() const 321 FloatSize HTMLVideoElement::elementSize() const
319 { 322 {
320 return FloatSize(videoWidth(), videoHeight()); 323 return FloatSize(videoWidth(), videoHeight());
321 } 324 }
322 325
323 } // namespace blink 326 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698