| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 "chrome/browser/ui/views/bubble_border.h" | 5 #include "chrome/browser/ui/views/bubble_border.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "gfx/canvas_skia.h" | |
| 9 #include "gfx/path.h" | |
| 10 #include "grit/theme_resources.h" | 8 #include "grit/theme_resources.h" |
| 11 #include "third_party/skia/include/core/SkBitmap.h" | 9 #include "third_party/skia/include/core/SkBitmap.h" |
| 12 #include "ui/base/resource/resource_bundle.h" | 10 #include "ui/base/resource/resource_bundle.h" |
| 11 #include "ui/gfx/canvas_skia.h" |
| 12 #include "ui/gfx/path.h" |
| 13 | 13 |
| 14 // static | 14 // static |
| 15 SkBitmap* BubbleBorder::left_ = NULL; | 15 SkBitmap* BubbleBorder::left_ = NULL; |
| 16 SkBitmap* BubbleBorder::top_left_ = NULL; | 16 SkBitmap* BubbleBorder::top_left_ = NULL; |
| 17 SkBitmap* BubbleBorder::top_ = NULL; | 17 SkBitmap* BubbleBorder::top_ = NULL; |
| 18 SkBitmap* BubbleBorder::top_right_ = NULL; | 18 SkBitmap* BubbleBorder::top_right_ = NULL; |
| 19 SkBitmap* BubbleBorder::right_ = NULL; | 19 SkBitmap* BubbleBorder::right_ = NULL; |
| 20 SkBitmap* BubbleBorder::bottom_right_ = NULL; | 20 SkBitmap* BubbleBorder::bottom_right_ = NULL; |
| 21 SkBitmap* BubbleBorder::bottom_ = NULL; | 21 SkBitmap* BubbleBorder::bottom_ = NULL; |
| 22 SkBitmap* BubbleBorder::bottom_left_ = NULL; | 22 SkBitmap* BubbleBorder::bottom_left_ = NULL; |
| (...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 paint.setColor(border_->background_color()); | 434 paint.setColor(border_->background_color()); |
| 435 gfx::Path path; | 435 gfx::Path path; |
| 436 gfx::Rect bounds(view->GetLocalBounds(false)); | 436 gfx::Rect bounds(view->GetLocalBounds(false)); |
| 437 SkRect rect; | 437 SkRect rect; |
| 438 rect.set(SkIntToScalar(bounds.x()), SkIntToScalar(bounds.y()), | 438 rect.set(SkIntToScalar(bounds.x()), SkIntToScalar(bounds.y()), |
| 439 SkIntToScalar(bounds.right()), SkIntToScalar(bounds.bottom())); | 439 SkIntToScalar(bounds.right()), SkIntToScalar(bounds.bottom())); |
| 440 SkScalar radius = SkIntToScalar(BubbleBorder::GetCornerRadius()); | 440 SkScalar radius = SkIntToScalar(BubbleBorder::GetCornerRadius()); |
| 441 path.addRoundRect(rect, radius, radius); | 441 path.addRoundRect(rect, radius, radius); |
| 442 canvas->AsCanvasSkia()->drawPath(path, paint); | 442 canvas->AsCanvasSkia()->drawPath(path, paint); |
| 443 } | 443 } |
| OLD | NEW |