OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CCVideoLayerImpl_h | 5 #ifndef CCVideoLayerImpl_h |
6 #define CCVideoLayerImpl_h | 6 #define CCVideoLayerImpl_h |
7 | 7 |
8 #include "IntSize.h" | 8 #include "IntSize.h" |
9 #include "base/synchronization/lock.h" | 9 #include "base/synchronization/lock.h" |
10 #include "cc/layer_impl.h" | 10 #include "cc/layer_impl.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 virtual void didUpdateMatrix(const float*); // Callable on impl thread. | 43 virtual void didUpdateMatrix(const float*); // Callable on impl thread. |
44 | 44 |
45 virtual void didLoseContext() OVERRIDE; | 45 virtual void didLoseContext() OVERRIDE; |
46 | 46 |
47 void setNeedsRedraw(); | 47 void setNeedsRedraw(); |
48 | 48 |
49 struct FramePlane { | 49 struct FramePlane { |
50 ResourceProvider::ResourceId resourceId; | 50 ResourceProvider::ResourceId resourceId; |
51 IntSize size; | 51 IntSize size; |
52 GLenum format; | 52 GLenum format; |
53 IntSize visibleSize; | |
54 | 53 |
55 FramePlane() : resourceId(0) { } | 54 FramePlane() : resourceId(0) { } |
56 | 55 |
57 bool allocateData(ResourceProvider*); | 56 bool allocateData(ResourceProvider*); |
58 void freeData(ResourceProvider*); | 57 void freeData(ResourceProvider*); |
59 }; | 58 }; |
60 | 59 |
61 private: | 60 private: |
62 VideoLayerImpl(int, WebKit::WebVideoFrameProvider*); | 61 VideoLayerImpl(int, WebKit::WebVideoFrameProvider*); |
63 | 62 |
64 static IntSize computeVisibleSize(const WebKit::WebVideoFrame&, unsigned pla
ne); | |
65 virtual const char* layerTypeAsString() const OVERRIDE; | 63 virtual const char* layerTypeAsString() const OVERRIDE; |
66 | 64 |
67 void willDrawInternal(ResourceProvider*); | 65 void willDrawInternal(ResourceProvider*); |
68 bool allocatePlaneData(ResourceProvider*); | 66 bool allocatePlaneData(ResourceProvider*); |
69 bool copyPlaneData(ResourceProvider*); | 67 bool copyPlaneData(ResourceProvider*); |
70 void freePlaneData(ResourceProvider*); | 68 void freePlaneData(ResourceProvider*); |
71 void freeUnusedPlaneData(ResourceProvider*); | 69 void freeUnusedPlaneData(ResourceProvider*); |
72 | 70 |
73 // Guards the destruction of m_provider and the frame that it provides | 71 // Guards the destruction of m_provider and the frame that it provides |
74 base::Lock m_providerLock; | 72 base::Lock m_providerLock; |
75 WebKit::WebVideoFrameProvider* m_provider; | 73 WebKit::WebVideoFrameProvider* m_provider; |
76 | 74 |
77 WebKit::WebTransformationMatrix m_streamTextureMatrix; | 75 WebKit::WebTransformationMatrix m_streamTextureMatrix; |
78 | 76 |
79 WebKit::WebVideoFrame* m_frame; | 77 WebKit::WebVideoFrame* m_frame; |
80 GLenum m_format; | 78 GLenum m_format; |
81 ResourceProvider::ResourceId m_externalTextureResource; | 79 ResourceProvider::ResourceId m_externalTextureResource; |
82 | 80 |
83 // Each index in this array corresponds to a plane in WebKit::WebVideoFrame. | 81 // Each index in this array corresponds to a plane in WebKit::WebVideoFrame. |
84 FramePlane m_framePlanes[WebKit::WebVideoFrame::maxPlanes]; | 82 FramePlane m_framePlanes[WebKit::WebVideoFrame::maxPlanes]; |
85 }; | 83 }; |
86 | 84 |
87 } | 85 } |
88 | 86 |
89 #endif // CCVideoLayerImpl_h | 87 #endif // CCVideoLayerImpl_h |
OLD | NEW |