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

Unified Diff: cc/output/forced_redraw_swap_promise.h

Issue 2185823005: Make RenderViewImpl::OnForceRedraw more robust (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix comments and add tests Created 4 years, 4 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: cc/output/forced_redraw_swap_promise.h
diff --git a/cc/output/forced_redraw_swap_promise.h b/cc/output/forced_redraw_swap_promise.h
new file mode 100644
index 0000000000000000000000000000000000000000..5bfa82c37626bda059b09dca4f3583a2dc6725cf
--- /dev/null
+++ b/cc/output/forced_redraw_swap_promise.h
@@ -0,0 +1,34 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CC_OUTPUT_FORCED_REDRAW_SWAP_PROMISE_H_
+#define CC_OUTPUT_FORCED_REDRAW_SWAP_PROMISE_H_
+
+#include "base/compiler_specific.h"
+#include "cc/output/swap_promise.h"
+#include "ui/events/latency_info.h"
+
+namespace cc {
+
+// This class represents promise which is robust to (will not be broken by)
+// |DidNotSwapReason::SWAP_FAILS| events.
+class CC_EXPORT ForcedRedrawSwapPromise : public SwapPromise {
danakj 2016/08/10 01:04:15 nit: i prefer AlwaysDrawSwapPromise. "Forced draws
svartmetal 2016/08/10 17:38:21 Fixed.
+ public:
+ explicit ForcedRedrawSwapPromise(const ui::LatencyInfo& latency_info);
+ ~ForcedRedrawSwapPromise() override;
+
+ void DidActivate() override {}
+ void DidSwap(CompositorFrameMetadata* metadata) override;
+ DidNotSwapAction DidNotSwap(DidNotSwapReason reason) override;
+ void OnCommit() override {}
+
+ int64_t TraceId() const override;
+
+ private:
+ ui::LatencyInfo latency_;
+};
+
+} // namespace cc
+
+#endif // CC_OUTPUT_FORCED_REDRAW_SWAP_PROMISE_H_

Powered by Google App Engine
This is Rietveld 408576698