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

Unified Diff: ui/compositor/compositing_recorder.cc

Issue 1062293003: tabstrip: Use a PaintRecorder to access the Canvas for painting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tabstrip-recorder: missing8 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 | « ui/compositor/compositing_recorder.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/compositing_recorder.cc
diff --git a/ui/compositor/compositing_recorder.cc b/ui/compositor/compositing_recorder.cc
index 18a8fa2efd6f11a59551cc093c0dd1f7c479e55e..20426af49ce9cfaf0c6bf79e0c08b86557c30de8 100644
--- a/ui/compositor/compositing_recorder.cc
+++ b/ui/compositor/compositing_recorder.cc
@@ -10,13 +10,15 @@
namespace ui {
CompositingRecorder::CompositingRecorder(const PaintContext& context,
- float opacity)
- : canvas_(context.canvas()) {
- canvas_->SaveLayerAlpha(0xff * opacity);
+ uint8_t alpha)
+ : canvas_(context.canvas()), saved_(alpha < 255) {
+ if (saved_)
+ canvas_->SaveLayerAlpha(alpha);
}
CompositingRecorder::~CompositingRecorder() {
- canvas_->Restore();
+ if (saved_)
+ canvas_->Restore();
}
} // namespace ui
« no previous file with comments | « ui/compositor/compositing_recorder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698