OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/app_list/views/cached_label.h" | 5 #include "ui/app_list/views/cached_label.h" |
6 | 6 |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 #include "ui/base/layout.h" | 9 #include "ui/base/layout.h" |
10 #include "ui/gfx/canvas.h" | 10 #include "ui/gfx/canvas.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 canvas.FillRect( | 30 canvas.FillRect( |
31 GetLocalBounds(), background_color(), SkXfermode::kSrc_Mode); | 31 GetLocalBounds(), background_color(), SkXfermode::kSrc_Mode); |
32 } | 32 } |
33 | 33 |
34 Label::OnPaint(&canvas); | 34 Label::OnPaint(&canvas); |
35 | 35 |
36 image_ = gfx::ImageSkia(canvas.ExtractImageRep()); | 36 image_ = gfx::ImageSkia(canvas.ExtractImageRep()); |
37 needs_repaint_ = false; | 37 needs_repaint_ = false; |
38 } | 38 } |
39 | 39 |
40 #if defined(OS_WIN) | |
41 void CachedLabel::OnPaint(gfx::Canvas* canvas) { | |
42 PaintToBackingImage(); | |
43 canvas->DrawImageInt(image_, 0, 0); | |
44 } | |
45 #endif | |
46 | |
47 void CachedLabel::OnDeviceScaleFactorChanged( | 40 void CachedLabel::OnDeviceScaleFactorChanged( |
48 float device_scale_factor) { | 41 float device_scale_factor) { |
49 Invalidate(); | 42 Invalidate(); |
50 Label::OnDeviceScaleFactorChanged(device_scale_factor); | 43 Label::OnDeviceScaleFactorChanged(device_scale_factor); |
51 } | 44 } |
52 | 45 |
53 } // namespace app_list | 46 } // namespace app_list |
OLD | NEW |