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

Unified Diff: aura/window.cc

Issue 7749020: Revert 98306 - Create a new views_aura_desktop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « aura/window.h ('k') | aura/window_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: aura/window.cc
===================================================================
--- aura/window.cc (revision 98311)
+++ aura/window.cc (working copy)
@@ -9,15 +9,17 @@
#include "aura/desktop.h"
#include "aura/window_delegate.h"
#include "base/logging.h"
-#include "ui/gfx/canvas_skia.h"
+#include "third_party/skia/include/core/SkCanvas.h"
#include "ui/gfx/compositor/compositor.h"
#include "ui/gfx/compositor/layer.h"
namespace aura {
-Window::Window(WindowDelegate* delegate)
- : delegate_(delegate),
+// TODO: do we need to support child windows?
+Window::Window(Desktop* desktop)
+ : delegate_(NULL),
visibility_(VISIBILITY_HIDDEN),
+ layer_(new ui::Layer(desktop->compositor())),
needs_paint_all_(true),
parent_(NULL),
id_(-1) {
@@ -26,10 +28,6 @@
Window::~Window() {
}
-void Window::Init() {
- layer_.reset(new ui::Layer(Desktop::GetInstance()->compositor()));
-}
-
void Window::SetVisibility(Visibility visibility) {
if (visibility_ == visibility)
return;
@@ -53,19 +51,12 @@
void Window::SetCanvas(const SkCanvas& canvas, const gfx::Point& origin) {
// TODO: figure out how this is going to work when animating the layer. In
- // particular if we're animating the size then the underlying Texture is going
+ // particular if we're animating the size then the underyling Texture is going
// to be unhappy if we try to set a texture on a size bigger than the size of
// the texture.
layer_->SetCanvas(canvas, origin);
}
-void Window::SetParent(Window* parent) {
- if (parent)
- parent->AddChild(this);
- else
- Desktop::GetInstance()->window()->AddChild(this);
-}
-
void Window::DrawTree() {
UpdateLayerCanvas();
Draw();
@@ -105,13 +96,8 @@
dirty_rect_.SetRect(0, 0, 0, 0);
if (dirty_rect.IsEmpty())
return;
- if (delegate_) {
- scoped_ptr<gfx::Canvas> canvas(gfx::Canvas::CreateCanvas(
- dirty_rect.width(), dirty_rect.height(), false));
- canvas->TranslateInt(dirty_rect.x(), dirty_rect.y());
- delegate_->OnPaint(canvas.get());
- SetCanvas(*canvas->AsCanvasSkia(), bounds().origin());
- }
+ if (delegate_)
+ delegate_->OnPaint(dirty_rect);
}
void Window::Draw() {
« no previous file with comments | « aura/window.h ('k') | aura/window_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698