OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CC_OUTPUT_SURFACE_H_ | |
6 #define CC_OUTPUT_SURFACE_H_ | |
7 | |
8 #define USE_CC_OUTPUT_SURFACE // TODO(danakj): Remove this. | |
9 | |
10 #include <public/WebCompositorOutputSurface.h> | |
11 | |
12 namespace cc { | |
13 | |
14 class CompositorFrame; | |
15 class OutputSurfaceClient; | |
16 class SoftwareOutputDevice; | |
17 | |
18 // Represents the output surface for a compositor. The compositor owns | |
19 // and manages its destruction. Its lifetime is: | |
20 // 1. Created on the main thread via WebLayerTreeView::createOutputSurface. | |
piman
2012/12/04 06:41:06
nit: doc probably needs updating
danakj
2012/12/04 18:15:34
I don't think this changed. The code paths are the
piman
2012/12/04 22:24:42
I was thinking here and below.
couple of things:
| |
21 // 2. Passed to the compositor thread and bound to a client via bindToClient. | |
22 // From here on, it will only be used on the compositor thread. | |
23 // 3. If the 3D context is lost, then the compositor will delete the output su rface | |
24 // (on the compositor thread) and go back to step 1. | |
25 class OutputSurface : public WebKit::WebCompositorOutputSurface { | |
26 public: | |
27 virtual ~OutputSurface() {} | |
28 | |
29 // Called by the compositor on the compositor thread. This is a place where th read-specific | |
30 // data for the output surface can be initialized, since from this point on th e output surface | |
31 // will only be used on the compositor thread. | |
32 virtual bool BindToClient(OutputSurfaceClient*) = 0; | |
33 | |
34 struct Capabilities { | |
35 Capabilities() | |
36 : has_parent_compositor(false) {} | |
37 | |
38 bool has_parent_compositor; | |
39 }; | |
40 | |
41 virtual const Capabilities& Capabilities() const = 0; | |
42 | |
43 // Obtain the 3d context or the software device associated with this output su rface. Either of these may return a null pointer, but not both. | |
jamesr
2012/12/04 07:06:51
80col
| |
44 // In the event of a lost context, the entire output surface should be recreat ed. | |
45 virtual WebKit::WebGraphicsContext3D* Context3D() const = 0; | |
46 virtual SoftwareOutputDevice* SoftwareDevice() const = 0; | |
47 | |
48 // Sends frame data to the parent compositor. This should only be called | |
49 // when capabilities().has_parent_pompositor. | |
50 virtual void SendFrameToParentCompositor(const CompositorFrame&) {} | |
51 }; | |
52 | |
53 } // namespace cc | |
54 | |
55 #endif // CC_OUTPUT_SURFACE_H_ | |
OLD | NEW |