| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 SERVICES_GFX_COMPOSITOR_RENDERER_STATE_H_ | 5 #ifndef SERVICES_GFX_COMPOSITOR_RENDERER_STATE_H_ |
| 6 #define SERVICES_GFX_COMPOSITOR_RENDERER_STATE_H_ | 6 #define SERVICES_GFX_COMPOSITOR_RENDERER_STATE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 SceneState* root_scene() { return root_scene_; } | 46 SceneState* root_scene() { return root_scene_; } |
| 47 uint32_t root_scene_version() { return root_scene_version_; } | 47 uint32_t root_scene_version() { return root_scene_version_; } |
| 48 const mojo::Rect& root_scene_viewport() { return root_scene_viewport_; } | 48 const mojo::Rect& root_scene_viewport() { return root_scene_viewport_; } |
| 49 | 49 |
| 50 // Sets the root scene and clears the current frame and cached dependencies. | 50 // Sets the root scene and clears the current frame and cached dependencies. |
| 51 // If different, invalidates the snapshot and returns true. | 51 // If different, invalidates the snapshot and returns true. |
| 52 bool SetRootScene(SceneState* scene, | 52 bool SetRootScene(SceneState* scene, |
| 53 uint32_t version, | 53 uint32_t version, |
| 54 const mojo::Rect& viewport); | 54 const mojo::Rect& viewport); |
| 55 | 55 |
| 56 // Resets the root scene and clears the current frame and cached dependencies. |
| 57 // If different, invalidates the snapshot and returns true. |
| 58 bool ResetRootScene(); |
| 59 |
| 56 // The currently composited frame, may be null if none. | 60 // The currently composited frame, may be null if none. |
| 57 const std::shared_ptr<RenderFrame>& frame() { return frame_; } | 61 const std::shared_ptr<RenderFrame>& frame() { return frame_; } |
| 58 | 62 |
| 59 // The current scene graph snapshot, may be null if none. | 63 // The current scene graph snapshot, may be null if none. |
| 60 const std::unique_ptr<Snapshot>& snapshot() { return snapshot_; } | 64 const std::unique_ptr<Snapshot>& snapshot() { return snapshot_; } |
| 61 | 65 |
| 62 // Returns true if the renderer has a snapshot and it is valid. | 66 // Returns true if the renderer has a snapshot and it is valid. |
| 63 // This implies that |frame()| is also non-null. | 67 // This implies that |frame()| is also non-null. |
| 64 bool valid() { return snapshot_ && snapshot_->valid(); } | 68 bool valid() { return snapshot_ && snapshot_->valid(); } |
| 65 | 69 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 90 base::WeakPtrFactory<RendererState> weak_factory_; | 94 base::WeakPtrFactory<RendererState> weak_factory_; |
| 91 | 95 |
| 92 DISALLOW_COPY_AND_ASSIGN(RendererState); | 96 DISALLOW_COPY_AND_ASSIGN(RendererState); |
| 93 }; | 97 }; |
| 94 | 98 |
| 95 std::ostream& operator<<(std::ostream& os, RendererState* renderer_state); | 99 std::ostream& operator<<(std::ostream& os, RendererState* renderer_state); |
| 96 | 100 |
| 97 } // namespace compositor | 101 } // namespace compositor |
| 98 | 102 |
| 99 #endif // SERVICES_GFX_COMPOSITOR_RENDERER_STATE_H_ | 103 #endif // SERVICES_GFX_COMPOSITOR_RENDERER_STATE_H_ |
| OLD | NEW |