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

Side by Side Diff: mojo/services/public/cpp/view_manager/lib/view.cc

Issue 534843002: Convert view manager to surfaces with uploading shim in client lib (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove overzealous shutdown check in cc/surfaces, add NON_EXPORTED_BASE for windows build, saturate… Created 6 years, 3 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 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/public/cpp/view_manager/view.h" 5 #include "mojo/services/public/cpp/view_manager/view.h"
6 6
7 #include "mojo/public/cpp/application/service_provider_impl.h" 7 #include "mojo/public/cpp/application/service_provider_impl.h"
8 #include "mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.h" 8 #include "mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.h"
9 #include "mojo/services/public/cpp/view_manager/lib/view_private.h" 9 #include "mojo/services/public/cpp/view_manager/lib/view_private.h"
10 #include "mojo/services/public/cpp/view_manager/view_observer.h" 10 #include "mojo/services/public/cpp/view_manager/view_observer.h"
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 // TODO(beng): this could be improved depending on how we decide to own views. 284 // TODO(beng): this could be improved depending on how we decide to own views.
285 Children::const_iterator it = children_.begin(); 285 Children::const_iterator it = children_.begin();
286 for (; it != children_.end(); ++it) { 286 for (; it != children_.end(); ++it) {
287 View* view = (*it)->GetChildById(id); 287 View* view = (*it)->GetChildById(id);
288 if (view) 288 if (view)
289 return view; 289 return view;
290 } 290 }
291 return NULL; 291 return NULL;
292 } 292 }
293 293
294 void View::SetSurfaceId(SurfaceIdPtr id) {
295 if (manager_) {
296 static_cast<ViewManagerClientImpl*>(manager_)->SetSurfaceId(id_, id.Pass());
297 }
298 }
299
294 void View::SetContents(const SkBitmap& contents) { 300 void View::SetContents(const SkBitmap& contents) {
295 if (manager_) { 301 if (manager_) {
296 static_cast<ViewManagerClientImpl*>(manager_)->SetViewContents(id_, 302 static_cast<ViewManagerClientImpl*>(manager_)->SetViewContents(id_,
297 contents); 303 contents);
298 } 304 }
299 } 305 }
300 306
301 void View::SetColor(SkColor color) { 307 void View::SetColor(SkColor color) {
302 gfx::Canvas canvas(bounds_.size(), 1.0f, true); 308 gfx::Canvas canvas(bounds_.size(), 1.0f, true);
303 canvas.DrawColor(color); 309 canvas.DrawColor(color);
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 } 384 }
379 385
380 void View::LocalSetBounds(const gfx::Rect& old_bounds, 386 void View::LocalSetBounds(const gfx::Rect& old_bounds,
381 const gfx::Rect& new_bounds) { 387 const gfx::Rect& new_bounds) {
382 DCHECK(old_bounds == bounds_); 388 DCHECK(old_bounds == bounds_);
383 ScopedSetBoundsNotifier notifier(this, old_bounds, new_bounds); 389 ScopedSetBoundsNotifier notifier(this, old_bounds, new_bounds);
384 bounds_ = new_bounds; 390 bounds_ = new_bounds;
385 } 391 }
386 392
387 } // namespace mojo 393 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698