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

Side by Side Diff: aura/desktop.cc

Issue 7534002: Shell of implementation for embedded windows. At this point this is (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Incorporate review feedback Created 9 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « aura/desktop.h ('k') | aura/desktop_host.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "aura/desktop.h"
6
7 #include <algorithm>
8
9 #include "aura/window.h"
10 #include "base/logging.h"
11 #include "ui/gfx/compositor/compositor.h"
12
13 namespace aura {
14
15 Desktop::Desktop(gfx::AcceleratedWidget widget, const gfx::Size& size)
16 : compositor_(ui::Compositor::Create(widget, size)) {
17 DCHECK(compositor_.get());
18 }
19
20 Desktop::~Desktop() {
21 }
22
23 void Desktop::Draw() {
24 // First pass updates the layer bitmaps.
25 for (Windows::iterator i = windows_.begin(); i != windows_.end(); ++i)
26 (*i)->UpdateLayerCanvas();
27
28 // Second pass renders the layers.
29 compositor_->NotifyStart();
30 for (Windows::iterator i = windows_.begin(); i != windows_.end(); ++i)
31 (*i)->Draw();
32 compositor_->NotifyEnd();
33 }
34
35 void Desktop::AddWindow(Window* window) {
36 DCHECK(std::find(windows_.begin(), windows_.end(), window) == windows_.end());
37 windows_.push_back(window);
38 }
39
40 void Desktop::RemoveWindow(Window* window) {
41 Windows::iterator i = std::find(windows_.begin(), windows_.end(), window);
42 DCHECK(i != windows_.end());
43 windows_.erase(i);
44 }
45
46 } // namespace aura
OLDNEW
« no previous file with comments | « aura/desktop.h ('k') | aura/desktop_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698