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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 | 197 |
198 void HTMLVideoElement::paintCurrentFrame(SkCanvas* canvas, const IntRect& destRe
ct, const SkPaint* paint) const | 198 void HTMLVideoElement::paintCurrentFrame(SkCanvas* canvas, const IntRect& destRe
ct, const SkPaint* paint) const |
199 { | 199 { |
200 if (!webMediaPlayer()) | 200 if (!webMediaPlayer()) |
201 return; | 201 return; |
202 | 202 |
203 SkXfermode::Mode mode; | 203 SkXfermode::Mode mode; |
204 if (!paint || !SkXfermode::AsMode(paint->getXfermode(), &mode)) | 204 if (!paint || !SkXfermode::AsMode(paint->getXfermode(), &mode)) |
205 mode = SkXfermode::kSrcOver_Mode; | 205 mode = SkXfermode::kSrcOver_Mode; |
206 | 206 |
207 // TODO(junov, foolip): crbug.com/456529 Pass the whole SkPaint instead of o
nly alpha and xfermode | 207 SkPaint mediaPaint; |
208 webMediaPlayer()->paint(canvas, destRect, paint ? paint->getAlpha() : 0xFF,
mode); | 208 if (paint) { |
| 209 mediaPaint = *paint; |
| 210 } else { |
| 211 mediaPaint.setAlpha(0xFF); |
| 212 mediaPaint.setFilterQuality(kLow_SkFilterQuality); |
| 213 } |
| 214 mediaPaint.setXfermodeMode(mode); |
| 215 |
| 216 webMediaPlayer()->paint(canvas, destRect, mediaPaint); |
209 } | 217 } |
210 | 218 |
211 bool HTMLVideoElement::copyVideoTextureToPlatformTexture(gpu::gles2::GLES2Interf
ace* gl, GLuint texture, GLenum internalFormat, GLenum type, bool premultiplyAlp
ha, bool flipY) | 219 bool HTMLVideoElement::copyVideoTextureToPlatformTexture(gpu::gles2::GLES2Interf
ace* gl, GLuint texture, GLenum internalFormat, GLenum type, bool premultiplyAlp
ha, bool flipY) |
212 { | 220 { |
213 if (!webMediaPlayer()) | 221 if (!webMediaPlayer()) |
214 return false; | 222 return false; |
215 | 223 |
216 DCHECK(Extensions3DUtil::canUseCopyTextureCHROMIUM(GL_TEXTURE_2D, internalFo
rmat, type, 0)); | 224 DCHECK(Extensions3DUtil::canUseCopyTextureCHROMIUM(GL_TEXTURE_2D, internalFo
rmat, type, 0)); |
217 return webMediaPlayer()->copyVideoTextureToPlatformTexture(gl, texture, inte
rnalFormat, type, premultiplyAlpha, flipY); | 225 return webMediaPlayer()->copyVideoTextureToPlatformTexture(gl, texture, inte
rnalFormat, type, premultiplyAlpha, flipY); |
218 } | 226 } |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 } | 348 } |
341 if ((cropRect && !ImageBitmap::isSourceSizeValid(cropRect->width(), cropRect
->height(), exceptionState)) | 349 if ((cropRect && !ImageBitmap::isSourceSizeValid(cropRect->width(), cropRect
->height(), exceptionState)) |
342 || !ImageBitmap::isSourceSizeValid(bitmapSourceSize().width(), bitmapSou
rceSize().height(), exceptionState)) | 350 || !ImageBitmap::isSourceSizeValid(bitmapSourceSize().width(), bitmapSou
rceSize().height(), exceptionState)) |
343 return ScriptPromise(); | 351 return ScriptPromise(); |
344 if (!ImageBitmap::isResizeOptionValid(options, exceptionState)) | 352 if (!ImageBitmap::isResizeOptionValid(options, exceptionState)) |
345 return ScriptPromise(); | 353 return ScriptPromise(); |
346 return ImageBitmapSource::fulfillImageBitmap(scriptState, ImageBitmap::creat
e(this, cropRect, eventTarget.toLocalDOMWindow()->document(), options)); | 354 return ImageBitmapSource::fulfillImageBitmap(scriptState, ImageBitmap::creat
e(this, cropRect, eventTarget.toLocalDOMWindow()->document(), options)); |
347 } | 355 } |
348 | 356 |
349 } // namespace blink | 357 } // namespace blink |
OLD | NEW |