| 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 #include "components/exo/sub_surface.h" | 5 #include "components/exo/sub_surface.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/trace_event/trace_event.h" | 8 #include "base/trace_event/trace_event.h" |
| 9 #include "base/trace_event/trace_event_argument.h" | 9 #include "base/trace_event/trace_event_argument.h" |
| 10 #include "components/exo/surface.h" | 10 #include "components/exo/surface.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 parent_->PlaceSubSurfaceBelow(surface_, sibling); | 73 parent_->PlaceSubSurfaceBelow(surface_, sibling); |
| 74 } | 74 } |
| 75 | 75 |
| 76 void SubSurface::SetCommitBehavior(bool synchronized) { | 76 void SubSurface::SetCommitBehavior(bool synchronized) { |
| 77 TRACE_EVENT1("exo", "SubSurface::SetCommitBehavior", "synchronized", | 77 TRACE_EVENT1("exo", "SubSurface::SetCommitBehavior", "synchronized", |
| 78 synchronized); | 78 synchronized); |
| 79 | 79 |
| 80 is_synchronized_ = synchronized; | 80 is_synchronized_ = synchronized; |
| 81 } | 81 } |
| 82 | 82 |
| 83 scoped_refptr<base::trace_event::TracedValue> SubSurface::AsTracedValue() | 83 scoped_ptr<base::trace_event::TracedValue> SubSurface::AsTracedValue() const { |
| 84 const { | 84 scoped_ptr<base::trace_event::TracedValue> value( |
| 85 scoped_refptr<base::trace_event::TracedValue> value = | 85 new base::trace_event::TracedValue()); |
| 86 new base::trace_event::TracedValue; | |
| 87 value->SetBoolean("is_synchronized", is_synchronized_); | 86 value->SetBoolean("is_synchronized", is_synchronized_); |
| 88 return value; | 87 return value; |
| 89 } | 88 } |
| 90 | 89 |
| 91 //////////////////////////////////////////////////////////////////////////////// | 90 //////////////////////////////////////////////////////////////////////////////// |
| 92 // SurfaceDelegate overrides: | 91 // SurfaceDelegate overrides: |
| 93 | 92 |
| 94 void SubSurface::OnSurfaceCommit() { | 93 void SubSurface::OnSurfaceCommit() { |
| 95 // Early out if commit should be synchronized with parent. | 94 // Early out if commit should be synchronized with parent. |
| 96 if (IsSurfaceSynchronized()) | 95 if (IsSurfaceSynchronized()) |
| (...skipping 20 matching lines...) Expand all Loading... |
| 117 parent_ = nullptr; | 116 parent_ = nullptr; |
| 118 return; | 117 return; |
| 119 } | 118 } |
| 120 DCHECK(surface == surface_); | 119 DCHECK(surface == surface_); |
| 121 if (parent_) | 120 if (parent_) |
| 122 parent_->RemoveSubSurface(surface_); | 121 parent_->RemoveSubSurface(surface_); |
| 123 surface_ = nullptr; | 122 surface_ = nullptr; |
| 124 } | 123 } |
| 125 | 124 |
| 126 } // namespace exo | 125 } // namespace exo |
| OLD | NEW |