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

Unified Diff: services/gfx/compositor/renderer_state.cc

Issue 1778793002: Mozart: Make Snapshot immutable. (Closed) Base URL: git@github.com:domokit/mojo.git@moz-2
Patch Set: Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « services/gfx/compositor/renderer_state.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/gfx/compositor/renderer_state.cc
diff --git a/services/gfx/compositor/renderer_state.cc b/services/gfx/compositor/renderer_state.cc
index 37bf319aac87a7a128a4766e76395e675b95cf25..eb4fa0e72f9fda345459f20c64c925d87b5e48f6 100644
--- a/services/gfx/compositor/renderer_state.cc
+++ b/services/gfx/compositor/renderer_state.cc
@@ -39,14 +39,10 @@ bool RendererState::ResetRootScene() {
return false;
}
-bool RendererState::SetSnapshot(std::unique_ptr<Snapshot> snapshot) {
- snapshot_ = std::move(snapshot);
- if (snapshot_ && snapshot_->valid()) {
- frame_ = snapshot_->frame();
- DCHECK(frame_);
- return true;
- }
- return false;
+void RendererState::SetSnapshot(const scoped_refptr<const Snapshot>& snapshot) {
+ current_snapshot_ = snapshot;
+ if (current_snapshot_ && !current_snapshot_->is_blocked())
+ visible_snapshot_ = current_snapshot_;
}
std::string RendererState::FormattedLabel() {
« no previous file with comments | « services/gfx/compositor/renderer_state.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698