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

Unified Diff: third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcherImpl.cpp

Issue 2848553003: Adjust OffscreenCanvas throttling to allow two frames of backlog (Closed)
Patch Set: better var names Created 3 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 | « third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcherImpl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcherImpl.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcherImpl.cpp b/third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcherImpl.cpp
index 0d87eec306c2bc795bf276b483b9ee1c830a56cc..13ff8e42ec18c2432d57e3fbd86e64db404eae05 100644
--- a/third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcherImpl.cpp
+++ b/third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcherImpl.cpp
@@ -27,6 +27,10 @@
namespace blink {
+enum {
+ kMaxPendingCompositorFrames = 2,
+};
+
OffscreenCanvasFrameDispatcherImpl::OffscreenCanvasFrameDispatcherImpl(
OffscreenCanvasFrameDispatcherClient* client,
uint32_t client_id,
@@ -399,14 +403,15 @@ void OffscreenCanvasFrameDispatcherImpl::DispatchFrame(
change_size_for_next_commit_ = false;
}
- compositor_has_pending_frame_ = true;
+ pending_compositor_frames_++;
sink_->SubmitCompositorFrame(current_local_surface_id_, std::move(frame));
}
void OffscreenCanvasFrameDispatcherImpl::DidReceiveCompositorFrameAck(
const cc::ReturnedResourceArray& resources) {
ReclaimResources(resources);
- compositor_has_pending_frame_ = false;
+ pending_compositor_frames_--;
+ DCHECK_GE(pending_compositor_frames_, 0);
}
void OffscreenCanvasFrameDispatcherImpl::SetNeedsBeginFrame(
@@ -426,7 +431,7 @@ void OffscreenCanvasFrameDispatcherImpl::OnBeginFrame(
begin_frame_args.source_id, begin_frame_args.sequence_number,
begin_frame_args.sequence_number, false);
- if (compositor_has_pending_frame_ ||
+ if (pending_compositor_frames_ >= kMaxPendingCompositorFrames ||
(begin_frame_args.type == cc::BeginFrameArgs::MISSED &&
base::TimeTicks::Now() > begin_frame_args.deadline)) {
sink_->BeginFrameDidNotSwap(current_begin_frame_ack_);
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcherImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698