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

Unified Diff: ui/views/bubble/tray_bubble_view.cc

Issue 1053143002: Make View::Paint use ui::PaintRecorder to access PaintContext's canvas (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: paintrecorder: . Created 5 years, 9 months 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 side-by-side diff with in-line comments
Download patch
Index: ui/views/bubble/tray_bubble_view.cc
diff --git a/ui/views/bubble/tray_bubble_view.cc b/ui/views/bubble/tray_bubble_view.cc
index babbe6dfd870c4f6a0cb3ffd9cc5e3036611d7fe..cf867d141f72c864438d6b7715ca88c05f05ca9d 100644
--- a/ui/views/bubble/tray_bubble_view.cc
+++ b/ui/views/bubble/tray_bubble_view.cc
@@ -15,6 +15,7 @@
#include "ui/aura/window.h"
#include "ui/compositor/layer.h"
#include "ui/compositor/layer_delegate.h"
+#include "ui/compositor/paint_context.h"
#include "ui/events/event.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/geometry/insets.h"
@@ -182,7 +183,7 @@ class TrayBubbleContentMask : public ui::LayerDelegate {
ui::Layer* layer() { return &layer_; }
// Overridden from LayerDelegate.
- void OnPaintLayer(gfx::Canvas* canvas) override;
+ void OnPaintLayer(const ui::PaintContext& context) override;
void OnDelegatedFrameDamage(const gfx::Rect& damage_rect_in_dip) override {}
void OnDeviceScaleFactorChanged(float device_scale_factor) override;
base::Closure PrepareForLayerBoundsChange() override;
@@ -204,12 +205,12 @@ TrayBubbleContentMask::~TrayBubbleContentMask() {
layer_.set_delegate(NULL);
}
-void TrayBubbleContentMask::OnPaintLayer(gfx::Canvas* canvas) {
+void TrayBubbleContentMask::OnPaintLayer(const ui::PaintContext& context) {
SkPaint paint;
paint.setAlpha(255);
paint.setStyle(SkPaint::kFill_Style);
gfx::Rect rect(layer()->bounds().size());
- canvas->DrawRoundRect(rect, corner_radius_, paint);
+ context.canvas()->DrawRoundRect(rect, corner_radius_, paint);
}
void TrayBubbleContentMask::OnDeviceScaleFactorChanged(

Powered by Google App Engine
This is Rietveld 408576698