Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(172)

Side by Side Diff: cc/video_layer_impl.h

Issue 11232051: Remove static thread pointers from CC (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "base/synchronization/lock.h" 8 #include "base/synchronization/lock.h"
9 #include "CCLayerImpl.h" 9 #include "CCLayerImpl.h"
10 #include "third_party/khronos/GLES2/gl2.h" 10 #include "third_party/khronos/GLES2/gl2.h"
11 #include "IntSize.h" 11 #include "IntSize.h"
12 #include <public/WebTransformationMatrix.h> 12 #include <public/WebTransformationMatrix.h>
13 #include <public/WebVideoFrameProvider.h> 13 #include <public/WebVideoFrameProvider.h>
14 #include <wtf/ThreadingPrimitives.h> 14 #include <wtf/ThreadingPrimitives.h>
15 15
16 namespace WebKit { 16 namespace WebKit {
17 class WebVideoFrame; 17 class WebVideoFrame;
18 } 18 }
19 19
20 namespace cc { 20 namespace cc {
21 21
22 class CCLayerTreeHostImpl; 22 class CCLayerTreeHostImpl;
23 class CCProxy;
23 class CCVideoLayerImpl; 24 class CCVideoLayerImpl;
24 25
25 class CCVideoLayerImpl : public CCLayerImpl 26 class CCVideoLayerImpl : public CCLayerImpl
26 , public WebKit::WebVideoFrameProvider::Client { 27 , public WebKit::WebVideoFrameProvider::Client {
27 public: 28 public:
28 static scoped_ptr<CCVideoLayerImpl> create(int id, WebKit::WebVideoFrameProv ider* provider) 29 static scoped_ptr<CCVideoLayerImpl> create(int id, WebKit::WebVideoFrameProv ider* provider)
29 { 30 {
30 return make_scoped_ptr(new CCVideoLayerImpl(id, provider)); 31 return make_scoped_ptr(new CCVideoLayerImpl(id, provider, NULL)); // FI XME
31 } 32 }
32 virtual ~CCVideoLayerImpl(); 33 virtual ~CCVideoLayerImpl();
33 34
34 virtual void willDraw(CCResourceProvider*) OVERRIDE; 35 virtual void willDraw(CCResourceProvider*) OVERRIDE;
35 virtual void appendQuads(CCQuadSink&, CCAppendQuadsData&) OVERRIDE; 36 virtual void appendQuads(CCQuadSink&, CCAppendQuadsData&) OVERRIDE;
36 virtual void didDraw(CCResourceProvider*) OVERRIDE; 37 virtual void didDraw(CCResourceProvider*) OVERRIDE;
37 38
38 virtual void dumpLayerProperties(std::string*, int indent) const OVERRIDE; 39 virtual void dumpLayerProperties(std::string*, int indent) const OVERRIDE;
39 40
40 // WebKit::WebVideoFrameProvider::Client implementation. 41 // WebKit::WebVideoFrameProvider::Client implementation.
(...skipping 11 matching lines...) Expand all
52 GLenum format; 53 GLenum format;
53 IntSize visibleSize; 54 IntSize visibleSize;
54 55
55 FramePlane() : resourceId(0) { } 56 FramePlane() : resourceId(0) { }
56 57
57 bool allocateData(CCResourceProvider*); 58 bool allocateData(CCResourceProvider*);
58 void freeData(CCResourceProvider*); 59 void freeData(CCResourceProvider*);
59 }; 60 };
60 61
61 private: 62 private:
62 CCVideoLayerImpl(int, WebKit::WebVideoFrameProvider*); 63 CCVideoLayerImpl(int, WebKit::WebVideoFrameProvider*, CCProxy*);
63 64
64 static IntSize computeVisibleSize(const WebKit::WebVideoFrame&, unsigned pla ne); 65 static IntSize computeVisibleSize(const WebKit::WebVideoFrame&, unsigned pla ne);
65 virtual const char* layerTypeAsString() const OVERRIDE; 66 virtual const char* layerTypeAsString() const OVERRIDE;
66 67
67 void willDrawInternal(CCResourceProvider*); 68 void willDrawInternal(CCResourceProvider*);
68 bool allocatePlaneData(CCResourceProvider*); 69 bool allocatePlaneData(CCResourceProvider*);
69 bool copyPlaneData(CCResourceProvider*); 70 bool copyPlaneData(CCResourceProvider*);
70 void freePlaneData(CCResourceProvider*); 71 void freePlaneData(CCResourceProvider*);
71 void freeUnusedPlaneData(CCResourceProvider*); 72 void freeUnusedPlaneData(CCResourceProvider*);
72 73
74 CCProxy* m_proxy;
75
73 // Guards the destruction of m_provider and the frame that it provides 76 // Guards the destruction of m_provider and the frame that it provides
74 base::Lock m_providerLock; 77 base::Lock m_providerLock;
75 WebKit::WebVideoFrameProvider* m_provider; 78 WebKit::WebVideoFrameProvider* m_provider;
76 79
77 WebKit::WebTransformationMatrix m_streamTextureMatrix; 80 WebKit::WebTransformationMatrix m_streamTextureMatrix;
78 81
79 WebKit::WebVideoFrame* m_frame; 82 WebKit::WebVideoFrame* m_frame;
80 GLenum m_format; 83 GLenum m_format;
81 CCResourceProvider::ResourceId m_externalTextureResource; 84 CCResourceProvider::ResourceId m_externalTextureResource;
82 85
83 // Each index in this array corresponds to a plane in WebKit::WebVideoFrame. 86 // Each index in this array corresponds to a plane in WebKit::WebVideoFrame.
84 FramePlane m_framePlanes[WebKit::WebVideoFrame::maxPlanes]; 87 FramePlane m_framePlanes[WebKit::WebVideoFrame::maxPlanes];
85 }; 88 };
86 89
87 } 90 }
88 91
89 #endif // CCVideoLayerImpl_h 92 #endif // CCVideoLayerImpl_h
OLDNEW
« cc/proxy.h ('K') | « cc/thread_proxy.cc ('k') | cc/video_layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698