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

Unified Diff: ash/utility/partial_screenshot_controller.cc

Issue 1062003003: ash: Access the Canvas for painting through PaintRecorder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ash-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 | ash/wm/boot_splash_screen_chromeos.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/utility/partial_screenshot_controller.cc
diff --git a/ash/utility/partial_screenshot_controller.cc b/ash/utility/partial_screenshot_controller.cc
index 466432c57a31ecd0a0271cf0846d4e6a06d56fa2..661d40565411d8f100741fcc938e050427539f45 100644
--- a/ash/utility/partial_screenshot_controller.cc
+++ b/ash/utility/partial_screenshot_controller.cc
@@ -11,6 +11,7 @@
#include "ash/shell_window_ids.h"
#include "base/stl_util.h"
#include "ui/compositor/paint_context.h"
+#include "ui/compositor/paint_recorder.h"
#include "ui/events/event_handler.h"
#include "ui/gfx/canvas.h"
#include "ui/wm/core/cursor_manager.h"
@@ -61,15 +62,15 @@ class PartialScreenshotController::PartialScreenshotLayer
if (region_.IsEmpty())
return;
- gfx::Canvas* canvas = context.canvas();
// Screenshot area representation: black rectangle with white
// rectangle inside. To avoid capturing these rectangles when mouse
// release, they should be outside of the actual capturing area.
+ ui::PaintRecorder recorder(context);
gfx::Rect rect(region_);
rect.Inset(-1, -1);
- canvas->DrawRect(rect, SK_ColorWHITE);
+ recorder.canvas()->DrawRect(rect, SK_ColorWHITE);
rect.Inset(-1, -1);
- canvas->DrawRect(rect, SK_ColorBLACK);
+ recorder.canvas()->DrawRect(rect, SK_ColorBLACK);
}
void OnDelegatedFrameDamage(const gfx::Rect& damage_rect_in_dip) override {}
« no previous file with comments | « no previous file | ash/wm/boot_splash_screen_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698