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

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

Issue 2755463002: [cc] Fix CompositorFrameSinkSupport BeginFrameAck interface. (Closed)
Patch Set: sync Created 3 years, 9 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 8cdbb05dc1246699d64a6776a91c745599992618..739f7a15dcb5a13b45822333492a560252a36219 100644
--- a/third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcherImpl.cpp
+++ b/third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcherImpl.cpp
@@ -210,6 +210,15 @@ void OffscreenCanvasFrameDispatcherImpl::dispatchFrame(
cc::CompositorFrame frame;
// TODO(crbug.com/652931): update the device_scale_factor
frame.metadata.device_scale_factor = 1.0f;
+ if (m_currentBeginFrameAck.sequence_number ==
+ cc::BeginFrameArgs::kInvalidFrameNumber) {
+ // TODO(eseckler): This shouldn't be necessary when OffscreenCanvas no
+ // longer submits CompositorFrames without prior BeginFrame.
+ m_currentBeginFrameAck = cc::BeginFrameAck::CreateManualAckWithDamage();
+ } else {
+ m_currentBeginFrameAck.has_damage = true;
+ }
+ frame.metadata.begin_frame_ack = m_currentBeginFrameAck;
const gfx::Rect bounds(m_width, m_height);
const int renderPassId = 1;
@@ -393,7 +402,14 @@ void OffscreenCanvasFrameDispatcherImpl::setNeedsBeginFrame(
void OffscreenCanvasFrameDispatcherImpl::OnBeginFrame(
const cc::BeginFrameArgs& beginFrameArgs) {
DCHECK(client());
+ // TODO(eseckler): Set correct |latest_confirmed_sequence_number|.
+ m_currentBeginFrameAck = cc::BeginFrameAck(
+ beginFrameArgs.source_id, beginFrameArgs.sequence_number,
+ beginFrameArgs.sequence_number, 0, false);
client()->beginFrame();
+ // TODO(eseckler): Tell |m_sink| if we did not draw during the BeginFrame.
+ m_currentBeginFrameAck.sequence_number =
+ cc::BeginFrameArgs::kInvalidFrameNumber;
}
void OffscreenCanvasFrameDispatcherImpl::ReclaimResources(
« 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