| 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 #include "ui/views/painter.h" | 5 #include "ui/views/painter.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 Painter::Painter() { | 251 Painter::Painter() { |
| 252 } | 252 } |
| 253 | 253 |
| 254 Painter::~Painter() { | 254 Painter::~Painter() { |
| 255 } | 255 } |
| 256 | 256 |
| 257 // static | 257 // static |
| 258 void Painter::PaintPainterAt(gfx::Canvas* canvas, | 258 void Painter::PaintPainterAt(gfx::Canvas* canvas, |
| 259 Painter* painter, | 259 Painter* painter, |
| 260 const gfx::Rect& rect) { | 260 const gfx::Rect& rect) { |
| 261 DCHECK(canvas && painter); | 261 DCHECK(canvas); |
| 262 DCHECK(painter); |
| 262 canvas->Save(); | 263 canvas->Save(); |
| 263 canvas->Translate(rect.OffsetFromOrigin()); | 264 canvas->Translate(rect.OffsetFromOrigin()); |
| 264 painter->Paint(canvas, rect.size()); | 265 painter->Paint(canvas, rect.size()); |
| 265 canvas->Restore(); | 266 canvas->Restore(); |
| 266 } | 267 } |
| 267 | 268 |
| 268 // static | 269 // static |
| 269 void Painter::PaintFocusPainter(View* view, | 270 void Painter::PaintFocusPainter(View* view, |
| 270 gfx::Canvas* canvas, | 271 gfx::Canvas* canvas, |
| 271 Painter* focus_painter) { | 272 Painter* focus_painter) { |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 canvas->DrawImageInt(*images_[LEFT], 0, 0); | 359 canvas->DrawImageInt(*images_[LEFT], 0, 0); |
| 359 canvas->DrawImageInt(*images_[RIGHT], size.width() - images_[RIGHT]->width(), | 360 canvas->DrawImageInt(*images_[RIGHT], size.width() - images_[RIGHT]->width(), |
| 360 0); | 361 0); |
| 361 canvas->TileImageInt( | 362 canvas->TileImageInt( |
| 362 *images_[CENTER], images_[LEFT]->width(), 0, | 363 *images_[CENTER], images_[LEFT]->width(), 0, |
| 363 size.width() - images_[LEFT]->width() - images_[RIGHT]->width(), | 364 size.width() - images_[LEFT]->width() - images_[RIGHT]->width(), |
| 364 images_[LEFT]->height()); | 365 images_[LEFT]->height()); |
| 365 } | 366 } |
| 366 | 367 |
| 367 } // namespace views | 368 } // namespace views |
| OLD | NEW |