Chromium Code Reviews| 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 CC_OUTPUT_SURFACE_H_ | 5 #ifndef CC_OUTPUT_SURFACE_H_ |
| 6 #define CC_OUTPUT_SURFACE_H_ | 6 #define CC_OUTPUT_SURFACE_H_ |
| 7 | 7 |
| 8 #define USE_CC_OUTPUT_SURFACE // TODO(danakj): Remove this. | 8 #define USE_CC_OUTPUT_SURFACE // TODO(danakj): Remove this. |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "cc/cc_export.h" | 12 #include "cc/cc_export.h" |
| 13 #include "cc/software_output_device.h" | 13 #include "cc/software_output_device.h" |
| 14 #include "third_party/WebKit/Source/Platform/chromium/public/WebCompositorOutput Surface.h" | 14 #include "third_party/WebKit/Source/Platform/chromium/public/WebCompositorOutput Surface.h" |
| 15 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3 D.h" | 15 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3 D.h" |
| 16 | 16 |
| 17 namespace gfx { | 17 namespace gfx { |
| 18 class Rect; | 18 class Rect; |
| 19 class Size; | 19 class Size; |
| 20 } | 20 } |
| 21 | 21 |
| 22 namespace cc { | 22 namespace cc { |
| 23 | 23 |
| 24 class CompositorFrame; | 24 class CompositorFrame; |
| 25 class OutputSurfaceClient; | 25 class OutputSurfaceClient; |
| 26 struct LatencyInfo; | |
| 26 | 27 |
| 27 // Represents the output surface for a compositor. The compositor owns | 28 // Represents the output surface for a compositor. The compositor owns |
| 28 // and manages its destruction. Its lifetime is: | 29 // and manages its destruction. Its lifetime is: |
| 29 // 1. Created on the main thread by the LayerTreeHost through its client. | 30 // 1. Created on the main thread by the LayerTreeHost through its client. |
| 30 // 2. Passed to the compositor thread and bound to a client via BindToClient. | 31 // 2. Passed to the compositor thread and bound to a client via BindToClient. |
| 31 // From here on, it will only be used on the compositor thread. | 32 // From here on, it will only be used on the compositor thread. |
| 32 // 3. If the 3D context is lost, then the compositor will delete the output | 33 // 3. If the 3D context is lost, then the compositor will delete the output |
| 33 // surface (on the compositor thread) and go back to step 1. | 34 // surface (on the compositor thread) and go back to step 1. |
| 34 class CC_EXPORT OutputSurface : public WebKit::WebCompositorOutputSurface { | 35 class CC_EXPORT OutputSurface : public WebKit::WebCompositorOutputSurface { |
| 35 public: | 36 public: |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 85 | 86 |
| 86 virtual void BindFramebuffer(); | 87 virtual void BindFramebuffer(); |
| 87 | 88 |
| 88 virtual void PostSubBuffer(gfx::Rect rect); | 89 virtual void PostSubBuffer(gfx::Rect rect); |
| 89 virtual void SwapBuffers(); | 90 virtual void SwapBuffers(); |
| 90 | 91 |
| 91 // Notifies frame-rate smoothness preference. If true, all non-critical | 92 // Notifies frame-rate smoothness preference. If true, all non-critical |
| 92 // processing should be stopped, or lowered in priority. | 93 // processing should be stopped, or lowered in priority. |
| 93 virtual void UpdateSmoothnessTakesPriority(bool prefer_smoothness) {} | 94 virtual void UpdateSmoothnessTakesPriority(bool prefer_smoothness) {} |
| 94 | 95 |
| 96 virtual void SetLatencyInfo(const LatencyInfo&) {} | |
|
piman
2013/03/19 04:30:29
What calls this, and in particular, what ensures o
| |
| 97 | |
| 95 protected: | 98 protected: |
| 96 OutputSurfaceClient* client_; | 99 OutputSurfaceClient* client_; |
| 97 struct cc::OutputSurface::Capabilities capabilities_; | 100 struct cc::OutputSurface::Capabilities capabilities_; |
| 98 scoped_ptr<WebKit::WebGraphicsContext3D> context3d_; | 101 scoped_ptr<WebKit::WebGraphicsContext3D> context3d_; |
| 99 scoped_ptr<cc::SoftwareOutputDevice> software_device_; | 102 scoped_ptr<cc::SoftwareOutputDevice> software_device_; |
| 100 bool has_gl_discard_backbuffer_; | 103 bool has_gl_discard_backbuffer_; |
| 101 | 104 |
| 102 private: | 105 private: |
| 103 DISALLOW_COPY_AND_ASSIGN(OutputSurface); | 106 DISALLOW_COPY_AND_ASSIGN(OutputSurface); |
| 104 }; | 107 }; |
| 105 | 108 |
| 106 } // namespace cc | 109 } // namespace cc |
| 107 | 110 |
| 108 #endif // CC_OUTPUT_SURFACE_H_ | 111 #endif // CC_OUTPUT_SURFACE_H_ |
| OLD | NEW |