OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #define _USE_MATH_DEFINES // For VC++ to get M_PI. This has to be first. | 5 #define _USE_MATH_DEFINES // For VC++ to get M_PI. This has to be first. |
6 | 6 |
7 #include "ui/views/view.h" | 7 #include "ui/views/view.h" |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <cmath> | 10 #include <cmath> |
(...skipping 1358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1369 | 1369 |
1370 void View::OnPaint(gfx::Canvas* canvas) { | 1370 void View::OnPaint(gfx::Canvas* canvas) { |
1371 TRACE_EVENT1("views", "View::OnPaint", "class", GetClassName()); | 1371 TRACE_EVENT1("views", "View::OnPaint", "class", GetClassName()); |
1372 OnPaintBackground(canvas); | 1372 OnPaintBackground(canvas); |
1373 OnPaintBorder(canvas); | 1373 OnPaintBorder(canvas); |
1374 } | 1374 } |
1375 | 1375 |
1376 void View::OnPaintBackground(gfx::Canvas* canvas) { | 1376 void View::OnPaintBackground(gfx::Canvas* canvas) { |
1377 if (background_.get()) { | 1377 if (background_.get()) { |
1378 TRACE_EVENT2("views", "View::OnPaintBackground", | 1378 TRACE_EVENT2("views", "View::OnPaintBackground", |
1379 "width", canvas->sk_canvas()->getDevice()->width(), | 1379 "width", canvas->sk_canvas()->getBaseLayerSize().width(), |
1380 "height", canvas->sk_canvas()->getDevice()->height()); | 1380 "height", canvas->sk_canvas()->getBaseLayerSize().height()); |
1381 background_->Paint(canvas, this); | 1381 background_->Paint(canvas, this); |
1382 } | 1382 } |
1383 } | 1383 } |
1384 | 1384 |
1385 void View::OnPaintBorder(gfx::Canvas* canvas) { | 1385 void View::OnPaintBorder(gfx::Canvas* canvas) { |
1386 if (border_.get()) { | 1386 if (border_.get()) { |
1387 TRACE_EVENT2("views", "View::OnPaintBorder", | 1387 TRACE_EVENT2("views", "View::OnPaintBorder", |
1388 "width", canvas->sk_canvas()->getDevice()->width(), | 1388 "width", canvas->sk_canvas()->getBaseLayerSize().width(), |
1389 "height", canvas->sk_canvas()->getDevice()->height()); | 1389 "height", canvas->sk_canvas()->getBaseLayerSize().height()); |
1390 border_->Paint(*this, canvas); | 1390 border_->Paint(*this, canvas); |
1391 } | 1391 } |
1392 } | 1392 } |
1393 | 1393 |
1394 // Accelerated Painting -------------------------------------------------------- | 1394 // Accelerated Painting -------------------------------------------------------- |
1395 | 1395 |
1396 void View::SetFillsBoundsOpaquely(bool fills_bounds_opaquely) { | 1396 void View::SetFillsBoundsOpaquely(bool fills_bounds_opaquely) { |
1397 // This method should not have the side-effect of creating the layer. | 1397 // This method should not have the side-effect of creating the layer. |
1398 if (layer()) | 1398 if (layer()) |
1399 layer()->SetFillsBoundsOpaquely(fills_bounds_opaquely); | 1399 layer()->SetFillsBoundsOpaquely(fills_bounds_opaquely); |
(...skipping 965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2365 // Message the RootView to do the drag and drop. That way if we're removed | 2365 // Message the RootView to do the drag and drop. That way if we're removed |
2366 // the RootView can detect it and avoid calling us back. | 2366 // the RootView can detect it and avoid calling us back. |
2367 gfx::Point widget_location(event.location()); | 2367 gfx::Point widget_location(event.location()); |
2368 ConvertPointToWidget(this, &widget_location); | 2368 ConvertPointToWidget(this, &widget_location); |
2369 widget->RunShellDrag(this, data, widget_location, drag_operations, source); | 2369 widget->RunShellDrag(this, data, widget_location, drag_operations, source); |
2370 // WARNING: we may have been deleted. | 2370 // WARNING: we may have been deleted. |
2371 return true; | 2371 return true; |
2372 } | 2372 } |
2373 | 2373 |
2374 } // namespace views | 2374 } // namespace views |
OLD | NEW |