OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "platform/graphics/OffscreenCanvasFrameDispatcherImpl.h" | 5 #include "platform/graphics/OffscreenCanvasFrameDispatcherImpl.h" |
6 | 6 |
7 #include "cc/output/compositor_frame.h" | 7 #include "cc/output/compositor_frame.h" |
8 #include "cc/quads/texture_draw_quad.h" | 8 #include "cc/quads/texture_draw_quad.h" |
9 #include "gpu/command_buffer/client/gles2_interface.h" | 9 #include "gpu/command_buffer/client/gles2_interface.h" |
10 #include "platform/CrossThreadFunctional.h" | 10 #include "platform/CrossThreadFunctional.h" |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 DCHECK(Client()); | 427 DCHECK(Client()); |
428 | 428 |
429 // TODO(eseckler): Set correct |latest_confirmed_sequence_number|. | 429 // TODO(eseckler): Set correct |latest_confirmed_sequence_number|. |
430 current_begin_frame_ack_ = cc::BeginFrameAck( | 430 current_begin_frame_ack_ = cc::BeginFrameAck( |
431 begin_frame_args.source_id, begin_frame_args.sequence_number, | 431 begin_frame_args.source_id, begin_frame_args.sequence_number, |
432 begin_frame_args.sequence_number, false); | 432 begin_frame_args.sequence_number, false); |
433 | 433 |
434 if (pending_compositor_frames_ >= kMaxPendingCompositorFrames || | 434 if (pending_compositor_frames_ >= kMaxPendingCompositorFrames || |
435 (begin_frame_args.type == cc::BeginFrameArgs::MISSED && | 435 (begin_frame_args.type == cc::BeginFrameArgs::MISSED && |
436 base::TimeTicks::Now() > begin_frame_args.deadline)) { | 436 base::TimeTicks::Now() > begin_frame_args.deadline)) { |
437 sink_->BeginFrameDidNotSwap(current_begin_frame_ack_); | 437 sink_->BeginFrameDidNotProduceFrame(current_begin_frame_ack_); |
438 return; | 438 return; |
439 } | 439 } |
440 | 440 |
441 Client()->BeginFrame(); | 441 Client()->BeginFrame(); |
442 // TODO(eseckler): Tell |m_sink| if we did not draw during the BeginFrame. | 442 // TODO(eseckler): Tell |m_sink| if we did not draw during the BeginFrame. |
443 current_begin_frame_ack_.sequence_number = | 443 current_begin_frame_ack_.sequence_number = |
444 cc::BeginFrameArgs::kInvalidFrameNumber; | 444 cc::BeginFrameArgs::kInvalidFrameNumber; |
445 } | 445 } |
446 | 446 |
447 void OffscreenCanvasFrameDispatcherImpl::ReclaimResources( | 447 void OffscreenCanvasFrameDispatcherImpl::ReclaimResources( |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
492 | 492 |
493 void OffscreenCanvasFrameDispatcherImpl::Reshape(int width, int height) { | 493 void OffscreenCanvasFrameDispatcherImpl::Reshape(int width, int height) { |
494 if (width_ != width || height_ != height) { | 494 if (width_ != width || height_ != height) { |
495 width_ = width; | 495 width_ = width; |
496 height_ = height; | 496 height_ = height; |
497 change_size_for_next_commit_ = true; | 497 change_size_for_next_commit_ = true; |
498 } | 498 } |
499 } | 499 } |
500 | 500 |
501 } // namespace blink | 501 } // namespace blink |
OLD | NEW |