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

Side by Side Diff: components/exo/surface.cc

Issue 2493223002: Change exo::SurfaceFactoryOwner to exo::ExoCompositorFrameSink (Closed)
Patch Set: Addressed comments: Created 4 years 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 unified diff | Download patch
OLDNEW
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/surface.h" 5 #include "components/exo/surface.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/callback_helpers.h" 9 #include "base/callback_helpers.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 if (window->parent()) 134 if (window->parent())
135 aura::Window::ConvertPointToTarget(window->parent(), window, 135 aura::Window::ConvertPointToTarget(window->parent(), window,
136 &local_point); 136 &local_point);
137 return surface->HitTestRect(gfx::Rect(local_point, gfx::Size(1, 1))); 137 return surface->HitTestRect(gfx::Rect(local_point, gfx::Size(1, 1)));
138 } 138 }
139 139
140 private: 140 private:
141 DISALLOW_COPY_AND_ASSIGN(CustomWindowTargeter); 141 DISALLOW_COPY_AND_ASSIGN(CustomWindowTargeter);
142 }; 142 };
143 143
144 void SatisfyCallback(cc::SurfaceManager* manager, 144 void SatisfyCallback(base::WeakPtr<CompositorFrameSinkHolder> frame_sink_holder,
145 const cc::SurfaceSequence& sequence) { 145 const cc::SurfaceSequence& sequence) {
146 std::vector<uint32_t> sequences; 146 if (frame_sink_holder)
147 sequences.push_back(sequence.sequence); 147 frame_sink_holder->GetCompositorFrameSink()->Satisfy(sequence);
148 manager->DidSatisfySequences(sequence.frame_sink_id, &sequences);
149 } 148 }
150 149
151 void RequireCallback(cc::SurfaceManager* manager, 150 void RequireCallback(base::WeakPtr<CompositorFrameSinkHolder> frame_sink_holder,
152 const cc::SurfaceId& id, 151 const cc::SurfaceId& id,
153 const cc::SurfaceSequence& sequence) { 152 const cc::SurfaceSequence& sequence) {
154 cc::Surface* surface = manager->GetSurfaceForId(id); 153 if (frame_sink_holder)
Fady Samuel 2016/12/07 20:13:00 braces
Alex Z. 2016/12/07 21:13:43 Done.
155 if (!surface) { 154 frame_sink_holder->GetCompositorFrameSink()->Require(id.local_frame_id(),
156 LOG(ERROR) << "Attempting to require callback on nonexistent surface"; 155 sequence);
157 return;
158 }
159 surface->AddDestructionDependency(sequence);
160 } 156 }
161 157
162 } // namespace 158 } // namespace
163 159
164 //////////////////////////////////////////////////////////////////////////////// 160 ////////////////////////////////////////////////////////////////////////////////
165 // SurfaceFactoryOwner, public:
166
167 SurfaceFactoryOwner::SurfaceFactoryOwner() {}
168
169 ////////////////////////////////////////////////////////////////////////////////
170 // cc::SurfaceFactoryClient overrides:
171
172 void SurfaceFactoryOwner::ReturnResources(
173 const cc::ReturnedResourceArray& resources) {
174 scoped_refptr<SurfaceFactoryOwner> holder(this);
175 for (auto& resource : resources) {
176 auto it = release_callbacks_.find(resource.id);
177 DCHECK(it != release_callbacks_.end());
178 it->second.second->Run(resource.sync_token, resource.lost);
179 release_callbacks_.erase(it);
180 }
181 }
182
183 void SurfaceFactoryOwner::WillDrawSurface(const cc::LocalFrameId& id,
184 const gfx::Rect& damage_rect) {
185 if (surface_)
186 surface_->WillDraw();
187 }
188
189 void SurfaceFactoryOwner::SetBeginFrameSource(
190 cc::BeginFrameSource* begin_frame_source) {
191 if (surface_)
192 surface_->SetBeginFrameSource(begin_frame_source);
193 }
194
195 ////////////////////////////////////////////////////////////////////////////////
196 // SurfaceFactoryOwner, private:
197
198 SurfaceFactoryOwner::~SurfaceFactoryOwner() {
199 if (surface_factory_->manager())
200 surface_factory_->manager()->InvalidateFrameSinkId(frame_sink_id_);
201 }
202
203 ////////////////////////////////////////////////////////////////////////////////
204 // Surface, public: 161 // Surface, public:
205 162
206 Surface::Surface() 163 Surface::Surface()
207 : window_(new aura::Window(new CustomWindowDelegate(this))), 164 : window_(new aura::Window(new CustomWindowDelegate(this))),
165 frame_sink_id_(
166 aura::Env::GetInstance()->context_factory()->AllocateFrameSinkId()),
208 surface_manager_( 167 surface_manager_(
209 aura::Env::GetInstance()->context_factory()->GetSurfaceManager()), 168 aura::Env::GetInstance()->context_factory()->GetSurfaceManager()) {
210 factory_owner_(new SurfaceFactoryOwner) { 169 cc::mojom::MojoCompositorFrameSinkClientPtr frame_sink_holder_ptr;
170 cc::mojom::MojoCompositorFrameSinkPtr frame_sink_ptr;
171 cc::mojom::MojoCompositorFrameSinkClientRequest frame_sink_client_request =
172 mojo::GetProxy(&frame_sink_holder_ptr);
173 CompositorFrameSink::Create(frame_sink_id_, surface_manager_,
174 std::move(frame_sink_holder_ptr),
175 mojo::GetProxy(&frame_sink_ptr));
176 compositor_frame_sink_holder_ = new CompositorFrameSinkHolder(
177 std::move(frame_sink_ptr), this, std::move(frame_sink_client_request));
211 window_->SetType(ui::wm::WINDOW_TYPE_CONTROL); 178 window_->SetType(ui::wm::WINDOW_TYPE_CONTROL);
212 window_->SetName("ExoSurface"); 179 window_->SetName("ExoSurface");
213 window_->SetProperty(kSurfaceKey, this); 180 window_->SetProperty(kSurfaceKey, this);
214 window_->Init(ui::LAYER_SOLID_COLOR); 181 window_->Init(ui::LAYER_SOLID_COLOR);
215 window_->SetEventTargeter(base::WrapUnique(new CustomWindowTargeter)); 182 window_->SetEventTargeter(base::WrapUnique(new CustomWindowTargeter));
216 window_->set_owned_by_parent(false); 183 window_->set_owned_by_parent(false);
217 window_->AddObserver(this); 184 window_->AddObserver(this);
218 factory_owner_->surface_ = this;
219 factory_owner_->frame_sink_id_ =
220 aura::Env::GetInstance()->context_factory()->AllocateFrameSinkId();
221 factory_owner_->id_allocator_.reset(new cc::SurfaceIdAllocator());
222 surface_manager_->RegisterFrameSinkId(factory_owner_->frame_sink_id_);
223 surface_manager_->RegisterSurfaceFactoryClient(factory_owner_->frame_sink_id_,
224 factory_owner_.get());
225 factory_owner_->surface_factory_.reset(new cc::SurfaceFactory(
226 factory_owner_->frame_sink_id_, surface_manager_, factory_owner_.get()));
227 aura::Env::GetInstance()->context_factory()->AddObserver(this); 185 aura::Env::GetInstance()->context_factory()->AddObserver(this);
228 } 186 }
229 187
230 Surface::~Surface() { 188 Surface::~Surface() {
231 aura::Env::GetInstance()->context_factory()->RemoveObserver(this); 189 aura::Env::GetInstance()->context_factory()->RemoveObserver(this);
232 for (SurfaceObserver& observer : observers_) 190 for (SurfaceObserver& observer : observers_)
233 observer.OnSurfaceDestroying(this); 191 observer.OnSurfaceDestroying(this);
234 192
235 window_->RemoveObserver(this); 193 window_->RemoveObserver(this);
236 window_->layer()->SetShowSolidColorContent(); 194 window_->layer()->SetShowSolidColorContent();
237 195
238 factory_owner_->surface_ = nullptr; 196 frame_callbacks_.splice(frame_callbacks_.end(), pending_frame_callbacks_);
197 compositor_frame_sink_holder_->ActivateFrameCallbacks(&frame_callbacks_);
198 compositor_frame_sink_holder_->CancelFrameCallbacks();
239 199
240 // Call pending frame callbacks with a null frame time to indicate that they 200 compositor_frame_sink_holder_->GetCompositorFrameSink()->EvictFrame();
241 // have been cancelled.
242 frame_callbacks_.splice(frame_callbacks_.end(), pending_frame_callbacks_);
243 active_frame_callbacks_.splice(active_frame_callbacks_.end(),
244 frame_callbacks_);
245 for (const auto& frame_callback : active_frame_callbacks_)
246 frame_callback.Run(base::TimeTicks());
247 if (begin_frame_source_ && needs_begin_frame_)
248 begin_frame_source_->RemoveObserver(this);
249
250 factory_owner_->surface_factory_->EvictSurface();
251
252 surface_manager_->UnregisterSurfaceFactoryClient(
253 factory_owner_->frame_sink_id_);
254 } 201 }
255 202
256 // static 203 // static
257 Surface* Surface::AsSurface(const aura::Window* window) { 204 Surface* Surface::AsSurface(const aura::Window* window) {
258 return window->GetProperty(kSurfaceKey); 205 return window->GetProperty(kSurfaceKey);
259 } 206 }
260 207
261 cc::SurfaceId Surface::GetSurfaceId() const { 208 cc::SurfaceId Surface::GetSurfaceId() const {
262 return cc::SurfaceId(factory_owner_->frame_sink_id_, local_frame_id_); 209 return cc::SurfaceId(frame_sink_id_, local_frame_id_);
263 } 210 }
264 211
265 void Surface::Attach(Buffer* buffer) { 212 void Surface::Attach(Buffer* buffer) {
266 TRACE_EVENT1("exo", "Surface::Attach", "buffer", 213 TRACE_EVENT1("exo", "Surface::Attach", "buffer",
267 buffer ? buffer->GetSize().ToString() : "null"); 214 buffer ? buffer->GetSize().ToString() : "null");
268 215
269 has_pending_contents_ = true; 216 has_pending_contents_ = true;
270 pending_buffer_.Reset(buffer ? buffer->AsWeakPtr() : base::WeakPtr<Buffer>()); 217 pending_buffer_.Reset(buffer ? buffer->AsWeakPtr() : base::WeakPtr<Buffer>());
271 } 218 }
272 219
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 has_pending_contents_ = false; 416 has_pending_contents_ = false;
470 417
471 current_buffer_ = std::move(pending_buffer_); 418 current_buffer_ = std::move(pending_buffer_);
472 419
473 UpdateResource(true); 420 UpdateResource(true);
474 } 421 }
475 422
476 cc::LocalFrameId old_local_frame_id = local_frame_id_; 423 cc::LocalFrameId old_local_frame_id = local_frame_id_;
477 if (needs_commit_to_new_surface_ || !local_frame_id_.is_valid()) { 424 if (needs_commit_to_new_surface_ || !local_frame_id_.is_valid()) {
478 needs_commit_to_new_surface_ = false; 425 needs_commit_to_new_surface_ = false;
479 local_frame_id_ = factory_owner_->id_allocator_->GenerateId(); 426 local_frame_id_ = id_allocator_.GenerateId();
480 } 427 }
481 428
482 UpdateSurface(true); 429 UpdateSurface(true);
483 430
484 if (old_local_frame_id != local_frame_id_) { 431 if (old_local_frame_id != local_frame_id_) {
485 float contents_surface_to_layer_scale = 1.0; 432 float contents_surface_to_layer_scale = 1.0;
486 // The bounds must be updated before switching to the new surface, because 433 // The bounds must be updated before switching to the new surface, because
487 // the layer may be mirrored, in which case a surface change causes the 434 // the layer may be mirrored, in which case a surface change causes the
488 // mirror layer to update its surface using the latest bounds. 435 // mirror layer to update its surface using the latest bounds.
489 window_->layer()->SetBounds( 436 window_->layer()->SetBounds(
490 gfx::Rect(window_->layer()->bounds().origin(), content_size_)); 437 gfx::Rect(window_->layer()->bounds().origin(), content_size_));
491 window_->layer()->SetShowSurface( 438 window_->layer()->SetShowSurface(
492 cc::SurfaceId(factory_owner_->frame_sink_id_, local_frame_id_), 439 cc::SurfaceId(frame_sink_id_, local_frame_id_),
493 base::Bind(&SatisfyCallback, base::Unretained(surface_manager_)), 440 base::Bind(&SatisfyCallback,
494 base::Bind(&RequireCallback, base::Unretained(surface_manager_)), 441 compositor_frame_sink_holder_->GetWeakPtr()),
442 base::Bind(&RequireCallback,
443 compositor_frame_sink_holder_->GetWeakPtr()),
495 content_size_, contents_surface_to_layer_scale, content_size_); 444 content_size_, contents_surface_to_layer_scale, content_size_);
496 window_->layer()->SetFillsBoundsOpaquely( 445 window_->layer()->SetFillsBoundsOpaquely(
497 state_.blend_mode == SkBlendMode::kSrc || 446 state_.blend_mode == SkBlendMode::kSrc ||
498 state_.opaque_region.contains( 447 state_.opaque_region.contains(
499 gfx::RectToSkIRect(gfx::Rect(content_size_)))); 448 gfx::RectToSkIRect(gfx::Rect(content_size_))));
500 } 449 }
501 450
502 // Reset damage. 451 // Reset damage.
503 pending_damage_.setEmpty(); 452 pending_damage_.setEmpty();
504 453
505 DCHECK(!current_resource_.id || 454 DCHECK(!current_resource_.id ||
506 factory_owner_->release_callbacks_.count(current_resource_.id)); 455 compositor_frame_sink_holder_->HasReleaseCallbacksForResource(
456 current_resource_.id));
507 457
508 // Move pending frame callbacks to the end of frame_callbacks_. 458 // Move pending frame callbacks to the end of frame_callbacks_.
509 frame_callbacks_.splice(frame_callbacks_.end(), pending_frame_callbacks_); 459 frame_callbacks_.splice(frame_callbacks_.end(), pending_frame_callbacks_);
510 460
511 // Synchronize window hierarchy. This will position and update the stacking 461 // Synchronize window hierarchy. This will position and update the stacking
512 // order of all sub-surfaces after committing all pending state of sub-surface 462 // order of all sub-surfaces after committing all pending state of sub-surface
513 // descendants. 463 // descendants.
514 aura::Window* stacking_target = nullptr; 464 aura::Window* stacking_target = nullptr;
515 for (auto& sub_surface_entry : pending_sub_surfaces_) { 465 for (auto& sub_surface_entry : pending_sub_surfaces_) {
516 Surface* sub_surface = sub_surface_entry.first; 466 Surface* sub_surface = sub_surface_entry.first;
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 } 551 }
602 552
603 std::unique_ptr<base::trace_event::TracedValue> Surface::AsTracedValue() const { 553 std::unique_ptr<base::trace_event::TracedValue> Surface::AsTracedValue() const {
604 std::unique_ptr<base::trace_event::TracedValue> value( 554 std::unique_ptr<base::trace_event::TracedValue> value(
605 new base::trace_event::TracedValue()); 555 new base::trace_event::TracedValue());
606 value->SetString("name", window_->layer()->name()); 556 value->SetString("name", window_->layer()->name());
607 return value; 557 return value;
608 } 558 }
609 559
610 void Surface::WillDraw() { 560 void Surface::WillDraw() {
611 active_frame_callbacks_.splice(active_frame_callbacks_.end(), 561 compositor_frame_sink_holder_->ActivateFrameCallbacks(&frame_callbacks_);
612 frame_callbacks_);
613 UpdateNeedsBeginFrame();
614 }
615
616 void Surface::SetBeginFrameSource(cc::BeginFrameSource* begin_frame_source) {
617 if (begin_frame_source_ && needs_begin_frame_) {
618 begin_frame_source_->RemoveObserver(this);
619 needs_begin_frame_ = false;
620 }
621 begin_frame_source_ = begin_frame_source;
622 UpdateNeedsBeginFrame();
623 } 562 }
624 563
625 void Surface::CheckIfSurfaceHierarchyNeedsCommitToNewSurfaces() { 564 void Surface::CheckIfSurfaceHierarchyNeedsCommitToNewSurfaces() {
626 if (HasLayerHierarchyChanged()) 565 if (HasLayerHierarchyChanged())
627 SetSurfaceHierarchyNeedsCommitToNewSurfaces(); 566 SetSurfaceHierarchyNeedsCommitToNewSurfaces();
628 } 567 }
629 568
630 void Surface::OnLostResources() { 569 void Surface::OnLostResources() {
631 if (!local_frame_id_.is_valid()) 570 if (!local_frame_id_.is_valid())
632 return; 571 return;
633 572
634 UpdateResource(false); 573 UpdateResource(false);
635 UpdateSurface(false); 574 UpdateSurface(false);
636 } 575 }
637 576
638 void Surface::OnWindowAddedToRootWindow(aura::Window* window) { 577 void Surface::OnWindowAddedToRootWindow(aura::Window* window) {
639 window->layer()->GetCompositor()->AddFrameSink( 578 window->layer()->GetCompositor()->AddFrameSink(frame_sink_id_);
640 factory_owner_->frame_sink_id_);
641 } 579 }
642 580
643 void Surface::OnWindowRemovingFromRootWindow(aura::Window* window, 581 void Surface::OnWindowRemovingFromRootWindow(aura::Window* window,
644 aura::Window* new_root) { 582 aura::Window* new_root) {
645 window->layer()->GetCompositor()->RemoveFrameSink( 583 window->layer()->GetCompositor()->RemoveFrameSink(frame_sink_id_);
646 factory_owner_->frame_sink_id_);
647 }
648
649 void Surface::OnBeginFrame(const cc::BeginFrameArgs& args) {
650 while (!active_frame_callbacks_.empty()) {
651 active_frame_callbacks_.front().Run(args.frame_time);
652 active_frame_callbacks_.pop_front();
653 }
654 last_begin_frame_args_ = args;
655 }
656
657 const cc::BeginFrameArgs& Surface::LastUsedBeginFrameArgs() const {
658 return last_begin_frame_args_;
659 } 584 }
660 585
661 Surface::State::State() : input_region(SkIRect::MakeLargest()) {} 586 Surface::State::State() : input_region(SkIRect::MakeLargest()) {}
662 587
663 Surface::State::~State() = default; 588 Surface::State::~State() = default;
664 589
665 bool Surface::State::operator==(const State& other) { 590 bool Surface::State::operator==(const State& other) {
666 return (other.crop == crop && alpha == other.alpha && 591 return (other.crop == crop && alpha == other.alpha &&
667 other.blend_mode == blend_mode && other.viewport == viewport && 592 other.blend_mode == blend_mode && other.viewport == viewport &&
668 other.opaque_region == opaque_region && 593 other.opaque_region == opaque_region &&
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
736 resource.id = next_resource_id_++; 661 resource.id = next_resource_id_++;
737 resource.format = cc::RGBA_8888; 662 resource.format = cc::RGBA_8888;
738 resource.filter = 663 resource.filter =
739 texture_mailbox.nearest_neighbor() ? GL_NEAREST : GL_LINEAR; 664 texture_mailbox.nearest_neighbor() ? GL_NEAREST : GL_LINEAR;
740 resource.size = texture_mailbox.size_in_pixels(); 665 resource.size = texture_mailbox.size_in_pixels();
741 resource.mailbox_holder = gpu::MailboxHolder(texture_mailbox.mailbox(), 666 resource.mailbox_holder = gpu::MailboxHolder(texture_mailbox.mailbox(),
742 texture_mailbox.sync_token(), 667 texture_mailbox.sync_token(),
743 texture_mailbox.target()); 668 texture_mailbox.target());
744 resource.is_overlay_candidate = texture_mailbox.is_overlay_candidate(); 669 resource.is_overlay_candidate = texture_mailbox.is_overlay_candidate();
745 670
746 factory_owner_->release_callbacks_[resource.id] = std::make_pair( 671 compositor_frame_sink_holder_->AddResourceReleaseCallback(
747 factory_owner_, std::move(texture_mailbox_release_callback)); 672 resource.id, std::move(texture_mailbox_release_callback));
748 current_resource_ = resource; 673 current_resource_ = resource;
749 } else { 674 } else {
750 current_resource_.id = 0; 675 current_resource_.id = 0;
751 current_resource_.size = gfx::Size(); 676 current_resource_.size = gfx::Size();
752 } 677 }
753 } 678 }
754 679
755 void Surface::UpdateSurface(bool full_damage) { 680 void Surface::UpdateSurface(bool full_damage) {
756 gfx::Size buffer_size = current_resource_.size; 681 gfx::Size buffer_size = current_resource_.size;
757 gfx::SizeF scaled_buffer_size( 682 gfx::SizeF scaled_buffer_size(
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
827 texture_quad->set_resource_size_in_pixels(current_resource_.size); 752 texture_quad->set_resource_size_in_pixels(current_resource_.size);
828 frame.resource_list.push_back(current_resource_); 753 frame.resource_list.push_back(current_resource_);
829 } 754 }
830 } else { 755 } else {
831 cc::SolidColorDrawQuad* solid_quad = 756 cc::SolidColorDrawQuad* solid_quad =
832 render_pass->CreateAndAppendDrawQuad<cc::SolidColorDrawQuad>(); 757 render_pass->CreateAndAppendDrawQuad<cc::SolidColorDrawQuad>();
833 solid_quad->SetNew(quad_state, quad_rect, quad_rect, SK_ColorBLACK, false); 758 solid_quad->SetNew(quad_state, quad_rect, quad_rect, SK_ColorBLACK, false);
834 } 759 }
835 760
836 frame.render_pass_list.push_back(std::move(render_pass)); 761 frame.render_pass_list.push_back(std::move(render_pass));
837 762 compositor_frame_sink_holder_->GetCompositorFrameSink()
838 factory_owner_->surface_factory_->SubmitCompositorFrame( 763 ->SubmitCompositorFrame(local_frame_id_, std::move(frame));
839 local_frame_id_, std::move(frame), cc::SurfaceFactory::DrawCallback());
840 }
841
842 void Surface::UpdateNeedsBeginFrame() {
843 if (!begin_frame_source_)
844 return;
845
846 bool needs_begin_frame = !active_frame_callbacks_.empty();
847 if (needs_begin_frame == needs_begin_frame_)
848 return;
849
850 needs_begin_frame_ = needs_begin_frame;
851 if (needs_begin_frame)
852 begin_frame_source_->AddObserver(this);
853 else
854 begin_frame_source_->RemoveObserver(this);
855 } 764 }
856 765
857 int64_t Surface::SetPropertyInternal(const void* key, 766 int64_t Surface::SetPropertyInternal(const void* key,
858 const char* name, 767 const char* name,
859 PropertyDeallocator deallocator, 768 PropertyDeallocator deallocator,
860 int64_t value, 769 int64_t value,
861 int64_t default_value) { 770 int64_t default_value) {
862 int64_t old = GetPropertyInternal(key, default_value); 771 int64_t old = GetPropertyInternal(key, default_value);
863 if (value == default_value) { 772 if (value == default_value) {
864 prop_map_.erase(key); 773 prop_map_.erase(key);
865 } else { 774 } else {
866 Value prop_value; 775 Value prop_value;
867 prop_value.name = name; 776 prop_value.name = name;
868 prop_value.value = value; 777 prop_value.value = value;
869 prop_value.deallocator = deallocator; 778 prop_value.deallocator = deallocator;
870 prop_map_[key] = prop_value; 779 prop_map_[key] = prop_value;
871 } 780 }
872 return old; 781 return old;
873 } 782 }
874 783
875 int64_t Surface::GetPropertyInternal(const void* key, 784 int64_t Surface::GetPropertyInternal(const void* key,
876 int64_t default_value) const { 785 int64_t default_value) const {
877 std::map<const void*, Value>::const_iterator iter = prop_map_.find(key); 786 std::map<const void*, Value>::const_iterator iter = prop_map_.find(key);
878 if (iter == prop_map_.end()) 787 if (iter == prop_map_.end())
879 return default_value; 788 return default_value;
880 return iter->second.value; 789 return iter->second.value;
881 } 790 }
882 791
883 } // namespace exo 792 } // namespace exo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698