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

Unified Diff: content/browser/web_contents/aura/overscroll_navigation_overlay.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
Index: content/browser/web_contents/aura/overscroll_navigation_overlay.cc
diff --git a/content/browser/web_contents/aura/overscroll_navigation_overlay.cc b/content/browser/web_contents/aura/overscroll_navigation_overlay.cc
index 344007e6e6b982177d3ed6919fa2ed2430614cbb..8948f9a8bfed397db4fc40ebb316dc79c1db6482 100644
--- a/content/browser/web_contents/aura/overscroll_navigation_overlay.cc
+++ b/content/browser/web_contents/aura/overscroll_navigation_overlay.cc
@@ -15,7 +15,7 @@
#include "ui/base/layout.h"
#include "ui/compositor/layer.h"
#include "ui/compositor/layer_animation_observer.h"
-#include "ui/compositor/paint_context.h"
+#include "ui/compositor/paint_recorder.h"
#include "ui/compositor/scoped_layer_animation_settings.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/image/image_png_rep.h"
@@ -59,16 +59,16 @@ class ImageLayerDelegate : public ui::LayerDelegate {
private:
// Overridden from ui::LayerDelegate:
void OnPaintLayer(const ui::PaintContext& context) override {
- gfx::Canvas* canvas = context.canvas();
+ ui::PaintRecorder recorder(context);
if (image_.IsEmpty()) {
- canvas->DrawColor(SK_ColorWHITE);
+ recorder.canvas()->DrawColor(SK_ColorWHITE);
} else {
- SkISize size = canvas->sk_canvas()->getDeviceSize();
+ SkISize size = recorder.canvas()->sk_canvas()->getDeviceSize();
if (size.width() != image_size_.width() ||
size.height() != image_size_.height()) {
- canvas->DrawColor(SK_ColorWHITE);
+ recorder.canvas()->DrawColor(SK_ColorWHITE);
}
- canvas->DrawImageInt(image_.AsImageSkia(), 0, 0);
+ recorder.canvas()->DrawImageInt(image_.AsImageSkia(), 0, 0);
}
}
« no previous file with comments | « content/browser/web_contents/aura/gesture_nav_simple.cc ('k') | content/browser/web_contents/aura/shadow_layer_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698