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

Unified Diff: content/browser/web_contents/aura/gesture_nav_simple.cc

Issue 1066183002: content/aura: Use a PaintRecorder to access the Canvas for painting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: content-recorder: . Created 5 years, 8 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
« no previous file with comments | « no previous file | content/browser/web_contents/aura/overscroll_navigation_overlay.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/aura/gesture_nav_simple.cc
diff --git a/content/browser/web_contents/aura/gesture_nav_simple.cc b/content/browser/web_contents/aura/gesture_nav_simple.cc
index 812cc6c70c942d188685ff833f70e2ea15b46cc2..4e83fdca5ea6710d006be3c34ebb8158e953f575 100644
--- a/content/browser/web_contents/aura/gesture_nav_simple.cc
+++ b/content/browser/web_contents/aura/gesture_nav_simple.cc
@@ -16,7 +16,7 @@
#include "ui/compositor/layer.h"
#include "ui/compositor/layer_animation_observer.h"
#include "ui/compositor/layer_delegate.h"
-#include "ui/compositor/paint_context.h"
+#include "ui/compositor/paint_recorder.h"
#include "ui/compositor/scoped_layer_animation_settings.h"
#include "ui/gfx/animation/tween.h"
#include "ui/gfx/canvas.h"
@@ -91,14 +91,13 @@ class ArrowLayerDelegate : public ui::LayerDelegate {
paint.setStyle(SkPaint::kFill_Style);
paint.setAntiAlias(true);
- gfx::Canvas* canvas = context.canvas();
- canvas->DrawCircle(
+ ui::PaintRecorder recorder(context);
+ recorder.canvas()->DrawCircle(
gfx::Point(left_arrow_ ? 0 : kArrowWidth, kArrowHeight / 2),
- kArrowWidth,
- paint);
- canvas->DrawImageInt(*image_.ToImageSkia(),
- left_arrow_ ? 0 : kArrowWidth - image_.Width(),
- (kArrowHeight - image_.Height()) / 2);
+ kArrowWidth, paint);
+ recorder.canvas()->DrawImageInt(
+ *image_.ToImageSkia(), left_arrow_ ? 0 : kArrowWidth - image_.Width(),
+ (kArrowHeight - image_.Height()) / 2);
}
void OnDelegatedFrameDamage(const gfx::Rect& damage_rect_in_dip) override {}
« no previous file with comments | « no previous file | content/browser/web_contents/aura/overscroll_navigation_overlay.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698