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 28 matching lines...) Expand all Loading... |
39 class ExceptionState; | 39 class ExceptionState; |
40 class HTMLImageLoader; | 40 class HTMLImageLoader; |
41 class GraphicsContext; | 41 class GraphicsContext; |
42 | 42 |
43 // GL types as defined in OpenGL ES 2.0 header file gl2.h from khronos.org. | 43 // GL types as defined in OpenGL ES 2.0 header file gl2.h from khronos.org. |
44 // That header cannot be included directly due to a conflict with NPAPI headers. | 44 // That header cannot be included directly due to a conflict with NPAPI headers. |
45 // See crbug.com/328085. | 45 // See crbug.com/328085. |
46 typedef unsigned GLenum; | 46 typedef unsigned GLenum; |
47 typedef int GC3Dint; | 47 typedef int GC3Dint; |
48 | 48 |
49 class HTMLVideoElement FINAL : public HTMLMediaElement, public CanvasImageSource
{ | 49 class HTMLVideoElement final : public HTMLMediaElement, public CanvasImageSource
{ |
50 DEFINE_WRAPPERTYPEINFO(); | 50 DEFINE_WRAPPERTYPEINFO(); |
51 public: | 51 public: |
52 static PassRefPtrWillBeRawPtr<HTMLVideoElement> create(Document&); | 52 static PassRefPtrWillBeRawPtr<HTMLVideoElement> create(Document&); |
53 virtual void trace(Visitor*) OVERRIDE; | 53 virtual void trace(Visitor*) override; |
54 | 54 |
55 unsigned videoWidth() const; | 55 unsigned videoWidth() const; |
56 unsigned videoHeight() const; | 56 unsigned videoHeight() const; |
57 | 57 |
58 // Fullscreen | 58 // Fullscreen |
59 void webkitEnterFullscreen(ExceptionState&); | 59 void webkitEnterFullscreen(ExceptionState&); |
60 void webkitExitFullscreen(); | 60 void webkitExitFullscreen(); |
61 bool webkitSupportsFullscreen(); | 61 bool webkitSupportsFullscreen(); |
62 bool webkitDisplayingFullscreen(); | 62 bool webkitDisplayingFullscreen(); |
63 | 63 |
64 // Statistics | 64 // Statistics |
65 unsigned webkitDecodedFrameCount() const; | 65 unsigned webkitDecodedFrameCount() const; |
66 unsigned webkitDroppedFrameCount() const; | 66 unsigned webkitDroppedFrameCount() const; |
67 | 67 |
68 // Used by canvas to gain raw pixel access | 68 // Used by canvas to gain raw pixel access |
69 void paintCurrentFrameInContext(GraphicsContext*, const IntRect&) const; | 69 void paintCurrentFrameInContext(GraphicsContext*, const IntRect&) const; |
70 | 70 |
71 // Used by WebGL to do GPU-GPU textures copy if possible. | 71 // Used by WebGL to do GPU-GPU textures copy if possible. |
72 // See more details at MediaPlayer::copyVideoTextureToPlatformTexture() defi
ned in Source/WebCore/platform/graphics/MediaPlayer.h. | 72 // See more details at MediaPlayer::copyVideoTextureToPlatformTexture() defi
ned in Source/WebCore/platform/graphics/MediaPlayer.h. |
73 bool copyVideoTextureToPlatformTexture(WebGraphicsContext3D*, Platform3DObje
ct texture, GC3Dint level, GLenum internalFormat, GLenum type, bool premultiplyA
lpha, bool flipY); | 73 bool copyVideoTextureToPlatformTexture(WebGraphicsContext3D*, Platform3DObje
ct texture, GC3Dint level, GLenum internalFormat, GLenum type, bool premultiplyA
lpha, bool flipY); |
74 | 74 |
75 bool shouldDisplayPosterImage() const { return displayMode() == Poster || di
splayMode() == PosterWaitingForVideo; } | 75 bool shouldDisplayPosterImage() const { return displayMode() == Poster || di
splayMode() == PosterWaitingForVideo; } |
76 | 76 |
77 KURL posterImageURL() const; | 77 KURL posterImageURL() const; |
78 | 78 |
79 // FIXME: Remove this when WebMediaPlayerClientImpl::loadInternal does not d
epend on it. | 79 // FIXME: Remove this when WebMediaPlayerClientImpl::loadInternal does not d
epend on it. |
80 virtual KURL mediaPlayerPosterURL() OVERRIDE; | 80 virtual KURL mediaPlayerPosterURL() override; |
81 | 81 |
82 // CanvasImageSource implementation | 82 // CanvasImageSource implementation |
83 virtual PassRefPtr<Image> getSourceImageForCanvas(SourceImageMode, SourceIma
geStatus*) const OVERRIDE; | 83 virtual PassRefPtr<Image> getSourceImageForCanvas(SourceImageMode, SourceIma
geStatus*) const override; |
84 virtual bool isVideoElement() const OVERRIDE { return true; } | 84 virtual bool isVideoElement() const override { return true; } |
85 virtual bool wouldTaintOrigin(SecurityOrigin*) const OVERRIDE; | 85 virtual bool wouldTaintOrigin(SecurityOrigin*) const override; |
86 virtual FloatSize sourceSize() const OVERRIDE; | 86 virtual FloatSize sourceSize() const override; |
87 virtual const KURL& sourceURL() const OVERRIDE { return currentSrc(); } | 87 virtual const KURL& sourceURL() const override { return currentSrc(); } |
88 | 88 |
89 virtual bool isHTMLVideoElement() const OVERRIDE { return true; } | 89 virtual bool isHTMLVideoElement() const override { return true; } |
90 | 90 |
91 private: | 91 private: |
92 HTMLVideoElement(Document&); | 92 HTMLVideoElement(Document&); |
93 | 93 |
94 virtual bool rendererIsNeeded(const RenderStyle&) OVERRIDE; | 94 virtual bool rendererIsNeeded(const RenderStyle&) override; |
95 virtual RenderObject* createRenderer(RenderStyle*) OVERRIDE; | 95 virtual RenderObject* createRenderer(RenderStyle*) override; |
96 virtual void attach(const AttachContext& = AttachContext()) OVERRIDE; | 96 virtual void attach(const AttachContext& = AttachContext()) override; |
97 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERR
IDE; | 97 virtual void parseAttribute(const QualifiedName&, const AtomicString&) overr
ide; |
98 virtual bool isPresentationAttribute(const QualifiedName&) const OVERRIDE; | 98 virtual bool isPresentationAttribute(const QualifiedName&) const override; |
99 virtual void collectStyleForPresentationAttribute(const QualifiedName&, cons
t AtomicString&, MutableStylePropertySet*) OVERRIDE; | 99 virtual void collectStyleForPresentationAttribute(const QualifiedName&, cons
t AtomicString&, MutableStylePropertySet*) override; |
100 virtual bool hasVideo() const OVERRIDE { return webMediaPlayer() && webMedia
Player()->hasVideo(); } | 100 virtual bool hasVideo() const override { return webMediaPlayer() && webMedia
Player()->hasVideo(); } |
101 bool supportsFullscreen() const; | 101 bool supportsFullscreen() const; |
102 virtual bool isURLAttribute(const Attribute&) const OVERRIDE; | 102 virtual bool isURLAttribute(const Attribute&) const override; |
103 virtual const AtomicString imageSourceURL() const OVERRIDE; | 103 virtual const AtomicString imageSourceURL() const override; |
104 | 104 |
105 bool hasAvailableVideoFrame() const; | 105 bool hasAvailableVideoFrame() const; |
106 virtual void updateDisplayState() OVERRIDE; | 106 virtual void updateDisplayState() override; |
107 virtual void didMoveToNewDocument(Document& oldDocument) OVERRIDE; | 107 virtual void didMoveToNewDocument(Document& oldDocument) override; |
108 virtual void setDisplayMode(DisplayMode) OVERRIDE; | 108 virtual void setDisplayMode(DisplayMode) override; |
109 | 109 |
110 OwnPtrWillBeMember<HTMLImageLoader> m_imageLoader; | 110 OwnPtrWillBeMember<HTMLImageLoader> m_imageLoader; |
111 | 111 |
112 AtomicString m_defaultPosterURL; | 112 AtomicString m_defaultPosterURL; |
113 }; | 113 }; |
114 | 114 |
115 } // namespace blink | 115 } // namespace blink |
116 | 116 |
117 #endif // HTMLVideoElement_h | 117 #endif // HTMLVideoElement_h |
OLD | NEW |