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/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "cc/cc_export.h" | 11 #include "cc/cc_export.h" |
| 12 #include "cc/software_output_device.h" | 12 #include "cc/software_output_device.h" |
| 13 #include "third_party/WebKit/Source/Platform/chromium/public/WebCompositorOutput Surface.h" | 13 #include "third_party/WebKit/Source/Platform/chromium/public/WebCompositorOutput Surface.h" |
| 14 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3 D.h" | 14 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3 D.h" |
| 15 | 15 |
| 16 namespace gfx { | |
| 17 class Rect; | |
| 18 class Size; | |
| 19 } | |
| 20 | |
| 16 namespace cc { | 21 namespace cc { |
| 17 | 22 |
| 18 class CompositorFrame; | 23 class CompositorFrame; |
| 19 class OutputSurfaceClient; | 24 class OutputSurfaceClient; |
| 20 | 25 |
| 21 // Represents the output surface for a compositor. The compositor owns | 26 // Represents the output surface for a compositor. The compositor owns |
| 22 // and manages its destruction. Its lifetime is: | 27 // and manages its destruction. Its lifetime is: |
| 23 // 1. Created on the main thread by the LayerTreeHost through its client. | 28 // 1. Created on the main thread by the LayerTreeHost through its client. |
| 24 // 2. Passed to the compositor thread and bound to a client via BindToClient. | 29 // 2. Passed to the compositor thread and bound to a client via BindToClient. |
| 25 // From here on, it will only be used on the compositor thread. | 30 // From here on, it will only be used on the compositor thread. |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 63 // thread-specific data for the output surface can be initialized, since from | 68 // thread-specific data for the output surface can be initialized, since from |
| 64 // this point on the output surface will only be used on the compositor | 69 // this point on the output surface will only be used on the compositor |
| 65 // thread. | 70 // thread. |
| 66 virtual bool BindToClient(OutputSurfaceClient*); | 71 virtual bool BindToClient(OutputSurfaceClient*); |
| 67 | 72 |
| 68 // Sends frame data to the parent compositor. This should only be called when | 73 // Sends frame data to the parent compositor. This should only be called when |
| 69 // capabilities().has_parent_compositor. The implementation may destroy or | 74 // capabilities().has_parent_compositor. The implementation may destroy or |
| 70 // steal the contents of the CompositorFrame passed in. | 75 // steal the contents of the CompositorFrame passed in. |
| 71 virtual void SendFrameToParentCompositor(CompositorFrame*); | 76 virtual void SendFrameToParentCompositor(CompositorFrame*); |
| 72 | 77 |
| 78 virtual void EnsureBackbuffer(); | |
| 79 virtual void DiscardBackbuffer(); | |
| 80 | |
| 81 virtual void Reshape(const gfx::Size& size); | |
|
danakj
2013/02/28 03:57:44
nit: pass Size/Point/Rect/Vector2d/SizeF/PointF by
no sievers
2013/02/28 18:43:40
Done.
| |
| 82 | |
| 83 virtual void BindFramebuffer(); | |
| 84 | |
| 85 virtual void PostSubBuffer(const gfx::Rect& rect); | |
|
danakj
2013/02/28 03:57:44
nit: by value
no sievers
2013/02/28 18:43:40
Done.
| |
| 86 virtual void SwapBuffers(); | |
| 87 | |
| 73 // Notifies frame-rate smoothness preference. If true, all non-critical | 88 // Notifies frame-rate smoothness preference. If true, all non-critical |
| 74 // processing should be stopped, or lowered in priority. | 89 // processing should be stopped, or lowered in priority. |
| 75 virtual void UpdateSmoothnessTakesPriority(bool prefer_smoothness) {} | 90 virtual void UpdateSmoothnessTakesPriority(bool prefer_smoothness) {} |
| 76 | 91 |
| 77 protected: | 92 protected: |
| 78 OutputSurfaceClient* client_; | 93 OutputSurfaceClient* client_; |
| 79 struct cc::OutputSurface::Capabilities capabilities_; | 94 struct cc::OutputSurface::Capabilities capabilities_; |
| 80 scoped_ptr<WebKit::WebGraphicsContext3D> context3d_; | 95 scoped_ptr<WebKit::WebGraphicsContext3D> context3d_; |
| 81 scoped_ptr<cc::SoftwareOutputDevice> software_device_; | 96 scoped_ptr<cc::SoftwareOutputDevice> software_device_; |
| 97 bool has_gl_discard_backbuffer_; | |
|
danakj
2013/02/28 03:57:44
nit: extra space
no sievers
2013/02/28 18:43:40
Done.
| |
| 82 }; | 98 }; |
| 83 | 99 |
| 84 } // namespace cc | 100 } // namespace cc |
| 85 | 101 |
| 86 #endif // CC_OUTPUT_SURFACE_H_ | 102 #endif // CC_OUTPUT_SURFACE_H_ |
| OLD | NEW |