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

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

Issue 1420843005: Revert of "webgl: optimize webgl.texSubImage2D(video) path." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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, const WebMediaPlayer::CopyVideoTextureParams& params) 209 bool HTMLVideoElement::copyVideoTextureToPlatformTexture(WebGraphicsContext3D* c ontext, Platform3DObject texture, GLenum internalFormat, GLenum type, bool premu ltiplyAlpha, bool flipY)
210 { 210 {
211 if (!webMediaPlayer()) 211 if (!webMediaPlayer())
212 return false; 212 return false;
213 213
214 ASSERT(Extensions3DUtil::canUseCopyTextureCHROMIUM(params.target, 214 ASSERT(Extensions3DUtil::canUseCopyTextureCHROMIUM(GL_TEXTURE_2D, internalFo rmat, type, 0));
215 params.copyType == WebMediaPlayer::CopyVideoTextureParams::SubCopy ? GL_ RGBA : params.internalFormat, 215 return webMediaPlayer()->copyVideoTextureToPlatformTexture(context, texture, internalFormat, type, premultiplyAlpha, flipY);
216 params.copyType == WebMediaPlayer::CopyVideoTextureParams::SubCopy ? GL_ UNSIGNED_BYTE : params.type,
217 params.level));
218 return webMediaPlayer()->copyVideoTextureToPlatformTexture(context, params);
219 } 216 }
220 217
221 bool HTMLVideoElement::hasAvailableVideoFrame() const 218 bool HTMLVideoElement::hasAvailableVideoFrame() const
222 { 219 {
223 if (!webMediaPlayer()) 220 if (!webMediaPlayer())
224 return false; 221 return false;
225 222
226 return webMediaPlayer()->hasVideo() && webMediaPlayer()->readyState() >= Web MediaPlayer::ReadyStateHaveCurrentData; 223 return webMediaPlayer()->hasVideo() && webMediaPlayer()->readyState() >= Web MediaPlayer::ReadyStateHaveCurrentData;
227 } 224 }
228 225
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 { 314 {
318 return !isMediaDataCORSSameOrigin(destinationSecurityOrigin); 315 return !isMediaDataCORSSameOrigin(destinationSecurityOrigin);
319 } 316 }
320 317
321 FloatSize HTMLVideoElement::elementSize() const 318 FloatSize HTMLVideoElement::elementSize() const
322 { 319 {
323 return FloatSize(videoWidth(), videoHeight()); 320 return FloatSize(videoWidth(), videoHeight());
324 } 321 }
325 322
326 } // namespace blink 323 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698