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 1347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1358 | 1358 |
1359 void View::OnPaint(gfx::Canvas* canvas) { | 1359 void View::OnPaint(gfx::Canvas* canvas) { |
1360 TRACE_EVENT1("views", "View::OnPaint", "class", GetClassName()); | 1360 TRACE_EVENT1("views", "View::OnPaint", "class", GetClassName()); |
1361 OnPaintBackground(canvas); | 1361 OnPaintBackground(canvas); |
1362 OnPaintBorder(canvas); | 1362 OnPaintBorder(canvas); |
1363 } | 1363 } |
1364 | 1364 |
1365 void View::OnPaintBackground(gfx::Canvas* canvas) { | 1365 void View::OnPaintBackground(gfx::Canvas* canvas) { |
1366 if (background_.get()) { | 1366 if (background_.get()) { |
1367 TRACE_EVENT2("views", "View::OnPaintBackground", | 1367 TRACE_EVENT2("views", "View::OnPaintBackground", |
1368 "width", canvas->sk_canvas()->getDevice()->width(), | 1368 "width", canvas->sk_canvas()->getBaseLayerSize().width(), |
1369 "height", canvas->sk_canvas()->getDevice()->height()); | 1369 "height", canvas->sk_canvas()->getBaseLayerSize().height()); |
1370 background_->Paint(canvas, this); | 1370 background_->Paint(canvas, this); |
1371 } | 1371 } |
1372 } | 1372 } |
1373 | 1373 |
1374 void View::OnPaintBorder(gfx::Canvas* canvas) { | 1374 void View::OnPaintBorder(gfx::Canvas* canvas) { |
1375 if (border_.get()) { | 1375 if (border_.get()) { |
1376 TRACE_EVENT2("views", "View::OnPaintBorder", | 1376 TRACE_EVENT2("views", "View::OnPaintBorder", |
1377 "width", canvas->sk_canvas()->getDevice()->width(), | 1377 "width", canvas->sk_canvas()->getBaseLayerSize().width(), |
1378 "height", canvas->sk_canvas()->getDevice()->height()); | 1378 "height", canvas->sk_canvas()->getBaseLayerSize().height()); |
1379 border_->Paint(*this, canvas); | 1379 border_->Paint(*this, canvas); |
1380 } | 1380 } |
1381 } | 1381 } |
1382 | 1382 |
1383 // Accelerated Painting -------------------------------------------------------- | 1383 // Accelerated Painting -------------------------------------------------------- |
1384 | 1384 |
1385 void View::SetFillsBoundsOpaquely(bool fills_bounds_opaquely) { | 1385 void View::SetFillsBoundsOpaquely(bool fills_bounds_opaquely) { |
1386 // This method should not have the side-effect of creating the layer. | 1386 // This method should not have the side-effect of creating the layer. |
1387 if (layer()) | 1387 if (layer()) |
1388 layer()->SetFillsBoundsOpaquely(fills_bounds_opaquely); | 1388 layer()->SetFillsBoundsOpaquely(fills_bounds_opaquely); |
(...skipping 965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2354 // Message the RootView to do the drag and drop. That way if we're removed | 2354 // Message the RootView to do the drag and drop. That way if we're removed |
2355 // the RootView can detect it and avoid calling us back. | 2355 // the RootView can detect it and avoid calling us back. |
2356 gfx::Point widget_location(event.location()); | 2356 gfx::Point widget_location(event.location()); |
2357 ConvertPointToWidget(this, &widget_location); | 2357 ConvertPointToWidget(this, &widget_location); |
2358 widget->RunShellDrag(this, data, widget_location, drag_operations, source); | 2358 widget->RunShellDrag(this, data, widget_location, drag_operations, source); |
2359 // WARNING: we may have been deleted. | 2359 // WARNING: we may have been deleted. |
2360 return true; | 2360 return true; |
2361 } | 2361 } |
2362 | 2362 |
2363 } // namespace views | 2363 } // namespace views |
OLD | NEW |