| 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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 return; | 200 return; |
| 201 | 201 |
| 202 SkXfermode::Mode mode; | 202 SkXfermode::Mode mode; |
| 203 if (!paint || !SkXfermode::AsMode(paint->getXfermode(), &mode)) | 203 if (!paint || !SkXfermode::AsMode(paint->getXfermode(), &mode)) |
| 204 mode = SkXfermode::kSrcOver_Mode; | 204 mode = SkXfermode::kSrcOver_Mode; |
| 205 | 205 |
| 206 // TODO(junov, philipj): crbug.com/456529 Pass the whole SkPaint instead of
only alpha and xfermode | 206 // TODO(junov, philipj): crbug.com/456529 Pass the whole SkPaint instead of
only alpha and xfermode |
| 207 webMediaPlayer()->paint(canvas, destRect, paint ? paint->getAlpha() : 0xFF,
mode); | 207 webMediaPlayer()->paint(canvas, destRect, paint ? paint->getAlpha() : 0xFF,
mode); |
| 208 } | 208 } |
| 209 | 209 |
| 210 bool HTMLVideoElement::copyVideoTextureToPlatformTexture(WebGraphicsContext3D* c
ontext, Platform3DObject texture, GLenum internalFormat, GLenum type, bool premu
ltiplyAlpha, bool flipY) | 210 bool HTMLVideoElement::copyVideoTextureToPlatformTexture(gpu::gles2::GLES2Interf
ace* gl, Platform3DObject texture, GLenum internalFormat, GLenum type, bool prem
ultiplyAlpha, bool flipY) |
| 211 { | 211 { |
| 212 if (!webMediaPlayer()) | 212 if (!webMediaPlayer()) |
| 213 return false; | 213 return false; |
| 214 | 214 |
| 215 ASSERT(Extensions3DUtil::canUseCopyTextureCHROMIUM(GL_TEXTURE_2D, internalFo
rmat, type, 0)); | 215 ASSERT(Extensions3DUtil::canUseCopyTextureCHROMIUM(GL_TEXTURE_2D, internalFo
rmat, type, 0)); |
| 216 return webMediaPlayer()->copyVideoTextureToPlatformTexture(context, texture,
internalFormat, type, premultiplyAlpha, flipY); | 216 return webMediaPlayer()->copyVideoTextureToPlatformTexture(gl, texture, inte
rnalFormat, type, premultiplyAlpha, flipY); |
| 217 } | 217 } |
| 218 | 218 |
| 219 bool HTMLVideoElement::hasAvailableVideoFrame() const | 219 bool HTMLVideoElement::hasAvailableVideoFrame() const |
| 220 { | 220 { |
| 221 if (!webMediaPlayer()) | 221 if (!webMediaPlayer()) |
| 222 return false; | 222 return false; |
| 223 | 223 |
| 224 return webMediaPlayer()->hasVideo() && webMediaPlayer()->getReadyState() >=
WebMediaPlayer::ReadyStateHaveCurrentData; | 224 return webMediaPlayer()->hasVideo() && webMediaPlayer()->getReadyState() >=
WebMediaPlayer::ReadyStateHaveCurrentData; |
| 225 } | 225 } |
| 226 | 226 |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 return ScriptPromise(); | 338 return ScriptPromise(); |
| 339 } | 339 } |
| 340 if (!sw || !sh) { | 340 if (!sw || !sh) { |
| 341 exceptionState.throwDOMException(IndexSizeError, String::format("The sou
rce %s provided is 0.", sw ? "height" : "width")); | 341 exceptionState.throwDOMException(IndexSizeError, String::format("The sou
rce %s provided is 0.", sw ? "height" : "width")); |
| 342 return ScriptPromise(); | 342 return ScriptPromise(); |
| 343 } | 343 } |
| 344 return ImageBitmapSource::fulfillImageBitmap(scriptState, ImageBitmap::creat
e(this, IntRect(sx, sy, sw, sh), eventTarget.toDOMWindow()->document(), options)
); | 344 return ImageBitmapSource::fulfillImageBitmap(scriptState, ImageBitmap::creat
e(this, IntRect(sx, sy, sw, sh), eventTarget.toDOMWindow()->document(), options)
); |
| 345 } | 345 } |
| 346 | 346 |
| 347 } // namespace blink | 347 } // namespace blink |
| OLD | NEW |