Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(225)

Side by Side Diff: ui/views/bubble/tray_bubble_view.cc

Issue 2523673004: [NOT FOR COMMIT] Fully replace SkCanvas uses.
Patch Set: Support Android build. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/views/bubble/bubble_border.cc ('k') | ui/views/color_chooser/color_chooser_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/bubble/tray_bubble_view.h" 5 #include "ui/views/bubble/tray_bubble_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "third_party/skia/include/core/SkCanvas.h" 10 #include "third_party/skia/include/core/SkCanvas.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 layer_.set_delegate(this); 105 layer_.set_delegate(this);
106 layer_.SetFillsBoundsOpaquely(false); 106 layer_.SetFillsBoundsOpaquely(false);
107 } 107 }
108 108
109 TrayBubbleContentMask::~TrayBubbleContentMask() { 109 TrayBubbleContentMask::~TrayBubbleContentMask() {
110 layer_.set_delegate(NULL); 110 layer_.set_delegate(NULL);
111 } 111 }
112 112
113 void TrayBubbleContentMask::OnPaintLayer(const ui::PaintContext& context) { 113 void TrayBubbleContentMask::OnPaintLayer(const ui::PaintContext& context) {
114 ui::PaintRecorder recorder(context, layer()->size()); 114 ui::PaintRecorder recorder(context, layer()->size());
115 SkPaint paint; 115 CdlPaint paint;
116 paint.setAlpha(255); 116 paint.setAlpha(255);
117 paint.setStyle(SkPaint::kFill_Style); 117 paint.setStyle(CdlPaint::kFill_Style);
118 gfx::Rect rect(layer()->bounds().size()); 118 gfx::Rect rect(layer()->bounds().size());
119 recorder.canvas()->DrawRoundRect(rect, corner_radius_, paint); 119 recorder.canvas()->DrawRoundRect(rect, corner_radius_, paint);
120 } 120 }
121 121
122 void TrayBubbleContentMask::OnDeviceScaleFactorChanged( 122 void TrayBubbleContentMask::OnDeviceScaleFactorChanged(
123 float device_scale_factor) { 123 float device_scale_factor) {
124 // Redrawing will take care of scale factor change. 124 // Redrawing will take care of scale factor change.
125 } 125 }
126 126
127 // Custom layout for the bubble-view. Does the default box-layout if there is 127 // Custom layout for the bubble-view. Does the default box-layout if there is
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 373
374 void TrayBubbleView::ViewHierarchyChanged( 374 void TrayBubbleView::ViewHierarchyChanged(
375 const ViewHierarchyChangedDetails& details) { 375 const ViewHierarchyChangedDetails& details) {
376 if (details.is_add && details.child == this) { 376 if (details.is_add && details.child == this) {
377 details.parent->SetPaintToLayer(true); 377 details.parent->SetPaintToLayer(true);
378 details.parent->layer()->SetMasksToBounds(true); 378 details.parent->layer()->SetMasksToBounds(true);
379 } 379 }
380 } 380 }
381 381
382 } // namespace views 382 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/bubble/bubble_border.cc ('k') | ui/views/color_chooser/color_chooser_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698