OLD | NEW |
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 Loading... |
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, GLenum target, |
| 210 Platform3DObject texture, GLenum internalFormat, GLenum type, GLint level, b
ool premultiplyAlpha, bool flipY) |
210 { | 211 { |
211 if (!webMediaPlayer()) | 212 if (!webMediaPlayer()) |
212 return false; | 213 return false; |
213 | 214 |
214 ASSERT(Extensions3DUtil::canUseCopyTextureCHROMIUM(GL_TEXTURE_2D, internalFo
rmat, type, 0)); | 215 ASSERT(Extensions3DUtil::canUseCopyTextureCHROMIUM(target, internalFormat, t
ype, level)); |
215 return webMediaPlayer()->copyVideoTextureToPlatformTexture(context, texture,
internalFormat, type, premultiplyAlpha, flipY); | 216 return webMediaPlayer()->copyVideoTextureToPlatformTexture(context, target,
texture, internalFormat, type, level, premultiplyAlpha, flipY); |
| 217 } |
| 218 |
| 219 bool HTMLVideoElement::copyVideoSubTextureToPlatformTexture(WebGraphicsContext3D
* context, GLenum target, |
| 220 Platform3DObject texture, GLint level, GLint xoffset, GLint yoffset, bool pr
emultiplyAlpha, bool flipY) |
| 221 { |
| 222 if (!webMediaPlayer()) |
| 223 return false; |
| 224 |
| 225 ASSERT(Extensions3DUtil::canUseCopyTextureCHROMIUM(target, GL_RGBA, GL_UNSIG
NED_BYTE, level)); |
| 226 return webMediaPlayer()->copyVideoSubTextureToPlatformTexture(context, targe
t, texture, level, |
| 227 xoffset, yoffset, premultiplyAlpha, flipY); |
216 } | 228 } |
217 | 229 |
218 bool HTMLVideoElement::hasAvailableVideoFrame() const | 230 bool HTMLVideoElement::hasAvailableVideoFrame() const |
219 { | 231 { |
220 if (!webMediaPlayer()) | 232 if (!webMediaPlayer()) |
221 return false; | 233 return false; |
222 | 234 |
223 return webMediaPlayer()->hasVideo() && webMediaPlayer()->readyState() >= Web
MediaPlayer::ReadyStateHaveCurrentData; | 235 return webMediaPlayer()->hasVideo() && webMediaPlayer()->readyState() >= Web
MediaPlayer::ReadyStateHaveCurrentData; |
224 } | 236 } |
225 | 237 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 { | 325 { |
314 return !isMediaDataCORSSameOrigin(destinationSecurityOrigin); | 326 return !isMediaDataCORSSameOrigin(destinationSecurityOrigin); |
315 } | 327 } |
316 | 328 |
317 FloatSize HTMLVideoElement::elementSize() const | 329 FloatSize HTMLVideoElement::elementSize() const |
318 { | 330 { |
319 return FloatSize(videoWidth(), videoHeight()); | 331 return FloatSize(videoWidth(), videoHeight()); |
320 } | 332 } |
321 | 333 |
322 } // namespace blink | 334 } // namespace blink |
OLD | NEW |