| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 virtual void didUpdateMatrix(const float*); // Callable on impl thread. | 42 virtual void didUpdateMatrix(const float*); // Callable on impl thread. |
| 43 | 43 |
| 44 virtual void didLoseContext() OVERRIDE; | 44 virtual void didLoseContext() OVERRIDE; |
| 45 | 45 |
| 46 void setNeedsRedraw(); | 46 void setNeedsRedraw(); |
| 47 | 47 |
| 48 struct FramePlane { | 48 struct FramePlane { |
| 49 ResourceProvider::ResourceId resourceId; | 49 ResourceProvider::ResourceId resourceId; |
| 50 IntSize size; | 50 IntSize size; |
| 51 GLenum format; | 51 GLenum format; |
| 52 IntSize visibleSize; | |
| 53 | 52 |
| 54 FramePlane() : resourceId(0) { } | 53 FramePlane() : resourceId(0) { } |
| 55 | 54 |
| 56 bool allocateData(ResourceProvider*); | 55 bool allocateData(ResourceProvider*); |
| 57 void freeData(ResourceProvider*); | 56 void freeData(ResourceProvider*); |
| 58 }; | 57 }; |
| 59 | 58 |
| 60 private: | 59 private: |
| 61 VideoLayerImpl(int, WebKit::WebVideoFrameProvider*); | 60 VideoLayerImpl(int, WebKit::WebVideoFrameProvider*); |
| 62 | 61 |
| 63 static IntSize computeVisibleSize(const WebKit::WebVideoFrame&, unsigned pla
ne); | |
| 64 virtual const char* layerTypeAsString() const OVERRIDE; | 62 virtual const char* layerTypeAsString() const OVERRIDE; |
| 65 | 63 |
| 66 void willDrawInternal(ResourceProvider*); | 64 void willDrawInternal(ResourceProvider*); |
| 67 bool allocatePlaneData(ResourceProvider*); | 65 bool allocatePlaneData(ResourceProvider*); |
| 68 bool copyPlaneData(ResourceProvider*); | 66 bool copyPlaneData(ResourceProvider*); |
| 69 void freePlaneData(ResourceProvider*); | 67 void freePlaneData(ResourceProvider*); |
| 70 void freeUnusedPlaneData(ResourceProvider*); | 68 void freeUnusedPlaneData(ResourceProvider*); |
| 71 | 69 |
| 72 // Guards the destruction of m_provider and the frame that it provides | 70 // Guards the destruction of m_provider and the frame that it provides |
| 73 base::Lock m_providerLock; | 71 base::Lock m_providerLock; |
| 74 WebKit::WebVideoFrameProvider* m_provider; | 72 WebKit::WebVideoFrameProvider* m_provider; |
| 75 | 73 |
| 76 WebKit::WebTransformationMatrix m_streamTextureMatrix; | 74 WebKit::WebTransformationMatrix m_streamTextureMatrix; |
| 77 | 75 |
| 78 WebKit::WebVideoFrame* m_frame; | 76 WebKit::WebVideoFrame* m_frame; |
| 79 GLenum m_format; | 77 GLenum m_format; |
| 80 ResourceProvider::ResourceId m_externalTextureResource; | 78 ResourceProvider::ResourceId m_externalTextureResource; |
| 81 | 79 |
| 82 // Each index in this array corresponds to a plane in WebKit::WebVideoFrame. | 80 // Each index in this array corresponds to a plane in WebKit::WebVideoFrame. |
| 83 FramePlane m_framePlanes[WebKit::WebVideoFrame::maxPlanes]; | 81 FramePlane m_framePlanes[WebKit::WebVideoFrame::maxPlanes]; |
| 84 }; | 82 }; |
| 85 | 83 |
| 86 } // namespace cc | 84 } // namespace cc |
| 87 | 85 |
| 88 #endif // CCVideoLayerImpl_h | 86 #endif // CCVideoLayerImpl_h |
| OLD | NEW |