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

Side by Side Diff: mojo/services/view_manager/display_manager.cc

Issue 692693002: Make it possible to change the viewport size (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Fix style nits Created 6 years, 1 month 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "mojo/services/view_manager/display_manager.h" 5 #include "mojo/services/view_manager/display_manager.h"
6 6
7 #include "base/numerics/safe_conversions.h" 7 #include "base/numerics/safe_conversions.h"
8 #include "cc/surfaces/surface_id_allocator.h" 8 #include "cc/surfaces/surface_id_allocator.h"
9 #include "mojo/converters/geometry/geometry_type_converters.h" 9 #include "mojo/converters/geometry/geometry_type_converters.h"
10 #include "mojo/converters/surfaces/surfaces_type_converters.h" 10 #include "mojo/converters/surfaces/surfaces_type_converters.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 return; 106 return;
107 dirty_rect_.Union(root_relative_rect); 107 dirty_rect_.Union(root_relative_rect);
108 if (!draw_timer_.IsRunning()) { 108 if (!draw_timer_.IsRunning()) {
109 draw_timer_.Start( 109 draw_timer_.Start(
110 FROM_HERE, 110 FROM_HERE,
111 base::TimeDelta(), 111 base::TimeDelta(),
112 base::Bind(&DisplayManager::Draw, base::Unretained(this))); 112 base::Bind(&DisplayManager::Draw, base::Unretained(this)));
113 } 113 }
114 } 114 }
115 115
116 void DisplayManager::SetViewportSize(const gfx::Size& size) {
117 native_viewport_->SetSize(Size::From(size));
118 }
119
116 void DisplayManager::OnCreatedNativeViewport(uint64_t native_viewport_id) { 120 void DisplayManager::OnCreatedNativeViewport(uint64_t native_viewport_id) {
117 } 121 }
118 122
119 void DisplayManager::OnSurfaceConnectionCreated(SurfacePtr surface, 123 void DisplayManager::OnSurfaceConnectionCreated(SurfacePtr surface,
120 uint32_t id_namespace) { 124 uint32_t id_namespace) {
121 surface_ = surface.Pass(); 125 surface_ = surface.Pass();
122 surface_.set_client(this); 126 surface_.set_client(this);
123 surface_id_allocator_.reset(new cc::SurfaceIdAllocator(id_namespace)); 127 surface_id_allocator_.reset(new cc::SurfaceIdAllocator(id_namespace));
124 Draw(); 128 Draw();
125 } 129 }
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 surface_id_ = cc::SurfaceId(); 167 surface_id_ = cc::SurfaceId();
164 SchedulePaint(connection_manager_->root(), gfx::Rect(size_)); 168 SchedulePaint(connection_manager_->root(), gfx::Rect(size_));
165 } 169 }
166 170
167 void DisplayManager::ReturnResources(Array<ReturnedResourcePtr> resources) { 171 void DisplayManager::ReturnResources(Array<ReturnedResourcePtr> resources) {
168 DCHECK_EQ(0u, resources.size()); 172 DCHECK_EQ(0u, resources.size());
169 } 173 }
170 174
171 } // namespace service 175 } // namespace service
172 } // namespace mojo 176 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/services/view_manager/display_manager.h ('k') | mojo/services/window_manager/window_manager_app.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698