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

Unified Diff: chrome/browser/chromeos/display/overscan_calibrator.cc

Issue 1066113002: chromeos: Use a PaintRecorder to access the Canvas for painting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 | chrome/browser/chromeos/ui/accessibility_focus_ring_layer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/display/overscan_calibrator.cc
diff --git a/chrome/browser/chromeos/display/overscan_calibrator.cc b/chrome/browser/chromeos/display/overscan_calibrator.cc
index b7eebc0e3654b0922cc018f7e4607051291c4f42..673ab8768084f66e5366c6308ebc1348c160fd93 100644
--- a/chrome/browser/chromeos/display/overscan_calibrator.cc
+++ b/chrome/browser/chromeos/display/overscan_calibrator.cc
@@ -12,7 +12,7 @@
#include "base/callback.h"
#include "ui/aura/window.h"
#include "ui/compositor/layer.h"
-#include "ui/compositor/paint_context.h"
+#include "ui/compositor/paint_recorder.h"
#include "ui/gfx/canvas.h"
namespace chromeos {
@@ -117,18 +117,20 @@ void OverscanCalibrator::UpdateInsets(const gfx::Insets& insets) {
}
void OverscanCalibrator::OnPaintLayer(const ui::PaintContext& context) {
- gfx::Canvas* canvas = context.canvas();
+ ui::PaintRecorder recorder(context);
static const SkColor kTransparent = SkColorSetARGB(0, 0, 0, 0);
gfx::Rect full_bounds = calibration_layer_->bounds();
gfx::Rect inner_bounds = full_bounds;
inner_bounds.Inset(insets_);
- canvas->FillRect(full_bounds, SK_ColorBLACK);
- canvas->FillRect(inner_bounds, kTransparent, SkXfermode::kClear_Mode);
+ recorder.canvas()->FillRect(full_bounds, SK_ColorBLACK);
+ recorder.canvas()->FillRect(inner_bounds, kTransparent,
+ SkXfermode::kClear_Mode);
gfx::Point center = inner_bounds.CenterPoint();
int vertical_offset = inner_bounds.height() / 2 - kArrowGapWidth;
int horizontal_offset = inner_bounds.width() / 2 - kArrowGapWidth;
+ gfx::Canvas* canvas = recorder.canvas();
DrawTriangle(center.x(), center.y() + vertical_offset, 0, canvas);
DrawTriangle(center.x(), center.y() - vertical_offset, 180, canvas);
DrawTriangle(center.x() - horizontal_offset, center.y(), 90, canvas);
« no previous file with comments | « no previous file | chrome/browser/chromeos/ui/accessibility_focus_ring_layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698