| 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 13 matching lines...) Expand all Loading... |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #ifndef HTMLVideoElement_h | 26 #ifndef HTMLVideoElement_h |
| 27 #define HTMLVideoElement_h | 27 #define HTMLVideoElement_h |
| 28 | 28 |
| 29 #include "core/CoreExport.h" | 29 #include "core/CoreExport.h" |
| 30 #include "core/html/HTMLImageLoader.h" | 30 #include "core/html/HTMLImageLoader.h" |
| 31 #include "core/html/HTMLMediaElement.h" | 31 #include "core/html/HTMLMediaElement.h" |
| 32 #include "core/html/canvas/CanvasImageSource.h" | 32 #include "core/html/canvas/CanvasImageSource.h" |
| 33 #include "core/imagebitmap/ImageBitmapSource.h" | 33 #include "core/imagebitmap/ImageBitmapSource.h" |
| 34 #include "platform/graphics/GraphicsTypes3D.h" | 34 #include "third_party/khronos/GLES2/gl2.h" |
| 35 | 35 |
| 36 class SkPaint; | 36 class SkPaint; |
| 37 | 37 |
| 38 namespace gpu { | 38 namespace gpu { |
| 39 namespace gles2 { | 39 namespace gles2 { |
| 40 class GLES2Interface; | 40 class GLES2Interface; |
| 41 } | 41 } |
| 42 } | 42 } |
| 43 | 43 |
| 44 namespace blink { | 44 namespace blink { |
| 45 class ExceptionState; | 45 class ExceptionState; |
| 46 class GraphicsContext; | 46 class GraphicsContext; |
| 47 class ImageBitmapOptions; | 47 class ImageBitmapOptions; |
| 48 | 48 |
| 49 // GL types as defined in OpenGL ES 2.0 header file gl2.h from khronos.org. | |
| 50 // That header cannot be included directly due to a conflict with NPAPI headers. | |
| 51 // See crbug.com/328085. | |
| 52 typedef unsigned GLenum; | |
| 53 typedef int GC3Dint; | |
| 54 | |
| 55 class CORE_EXPORT HTMLVideoElement final : public HTMLMediaElement, public Canva
sImageSource, public ImageBitmapSource { | 49 class CORE_EXPORT HTMLVideoElement final : public HTMLMediaElement, public Canva
sImageSource, public ImageBitmapSource { |
| 56 DEFINE_WRAPPERTYPEINFO(); | 50 DEFINE_WRAPPERTYPEINFO(); |
| 57 public: | 51 public: |
| 58 static HTMLVideoElement* create(Document&); | 52 static HTMLVideoElement* create(Document&); |
| 59 DECLARE_VIRTUAL_TRACE(); | 53 DECLARE_VIRTUAL_TRACE(); |
| 60 | 54 |
| 61 unsigned videoWidth() const; | 55 unsigned videoWidth() const; |
| 62 unsigned videoHeight() const; | 56 unsigned videoHeight() const; |
| 63 | 57 |
| 64 // Fullscreen | 58 // Fullscreen |
| 65 void webkitEnterFullscreen(); | 59 void webkitEnterFullscreen(); |
| 66 void webkitExitFullscreen(); | 60 void webkitExitFullscreen(); |
| 67 bool webkitSupportsFullscreen(); | 61 bool webkitSupportsFullscreen(); |
| 68 bool webkitDisplayingFullscreen(); | 62 bool webkitDisplayingFullscreen(); |
| 69 bool usesOverlayFullscreenVideo() const override; | 63 bool usesOverlayFullscreenVideo() const override; |
| 70 | 64 |
| 71 // Statistics | 65 // Statistics |
| 72 unsigned webkitDecodedFrameCount() const; | 66 unsigned webkitDecodedFrameCount() const; |
| 73 unsigned webkitDroppedFrameCount() const; | 67 unsigned webkitDroppedFrameCount() const; |
| 74 | 68 |
| 75 // Used by canvas to gain raw pixel access | 69 // Used by canvas to gain raw pixel access |
| 76 void paintCurrentFrame(SkCanvas*, const IntRect&, const SkPaint*) const; | 70 void paintCurrentFrame(SkCanvas*, const IntRect&, const SkPaint*) const; |
| 77 | 71 |
| 78 // Used by WebGL to do GPU-GPU textures copy if possible. | 72 // Used by WebGL to do GPU-GPU textures copy if possible. |
| 79 bool copyVideoTextureToPlatformTexture(gpu::gles2::GLES2Interface*, Platform
3DObject texture, GLenum internalFormat, GLenum type, bool premultiplyAlpha, boo
l flipY); | 73 bool copyVideoTextureToPlatformTexture(gpu::gles2::GLES2Interface*, GLuint t
exture, GLenum internalFormat, GLenum type, bool premultiplyAlpha, bool flipY); |
| 80 | 74 |
| 81 bool shouldDisplayPosterImage() const { return getDisplayMode() == Poster; } | 75 bool shouldDisplayPosterImage() const { return getDisplayMode() == Poster; } |
| 82 | 76 |
| 83 bool hasAvailableVideoFrame() const; | 77 bool hasAvailableVideoFrame() const; |
| 84 | 78 |
| 85 KURL posterImageURL() const override; | 79 KURL posterImageURL() const override; |
| 86 | 80 |
| 87 // CanvasImageSource implementation | 81 // CanvasImageSource implementation |
| 88 PassRefPtr<Image> getSourceImageForCanvas(SourceImageStatus*, AccelerationHi
nt, SnapshotReason, const FloatSize&) const override; | 82 PassRefPtr<Image> getSourceImageForCanvas(SourceImageStatus*, AccelerationHi
nt, SnapshotReason, const FloatSize&) const override; |
| 89 bool isVideoElement() const override { return true; } | 83 bool isVideoElement() const override { return true; } |
| (...skipping 24 matching lines...) Expand all Loading... |
| 114 void setDisplayMode(DisplayMode) override; | 108 void setDisplayMode(DisplayMode) override; |
| 115 | 109 |
| 116 Member<HTMLImageLoader> m_imageLoader; | 110 Member<HTMLImageLoader> m_imageLoader; |
| 117 | 111 |
| 118 AtomicString m_defaultPosterURL; | 112 AtomicString m_defaultPosterURL; |
| 119 }; | 113 }; |
| 120 | 114 |
| 121 } // namespace blink | 115 } // namespace blink |
| 122 | 116 |
| 123 #endif // HTMLVideoElement_h | 117 #endif // HTMLVideoElement_h |
| OLD | NEW |