| 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 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 // the MailTextureHolder to a SkiaTextureHolder. In this case, we | 434 // the MailTextureHolder to a SkiaTextureHolder. In this case, we |
| 435 // need to wait for the new sync token passed by CompositorFrameSink. | 435 // need to wait for the new sync token passed by CompositorFrameSink. |
| 436 SharedGpuContext::gl()->WaitSyncTokenCHROMIUM( | 436 SharedGpuContext::gl()->WaitSyncTokenCHROMIUM( |
| 437 resource.sync_token.GetConstData()); | 437 resource.sync_token.GetConstData()); |
| 438 } | 438 } |
| 439 } | 439 } |
| 440 reclaimResource(resource.id); | 440 reclaimResource(resource.id); |
| 441 } | 441 } |
| 442 } | 442 } |
| 443 | 443 |
| 444 void OffscreenCanvasFrameDispatcherImpl::WillDrawSurface( | |
| 445 const cc::LocalSurfaceId& localSurfaceId, | |
| 446 ::gfx::mojom::blink::RectPtr damageRect) { | |
| 447 // TODO(fsamuel, staraz): Implement this. | |
| 448 } | |
| 449 | |
| 450 void OffscreenCanvasFrameDispatcherImpl::reclaimResource(unsigned resourceId) { | 444 void OffscreenCanvasFrameDispatcherImpl::reclaimResource(unsigned resourceId) { |
| 451 // An image resource needs to be returned by both the | 445 // An image resource needs to be returned by both the |
| 452 // CompositorFrameSink and the HTMLCanvasElement. These | 446 // CompositorFrameSink and the HTMLCanvasElement. These |
| 453 // events can happen in any order. The first of the two | 447 // events can happen in any order. The first of the two |
| 454 // to return a given resource will result in the spare | 448 // to return a given resource will result in the spare |
| 455 // resource lock being lifted, and the second will delete | 449 // resource lock being lifted, and the second will delete |
| 456 // the resource for real. | 450 // the resource for real. |
| 457 if (m_spareResourceLocks.contains(resourceId)) { | 451 if (m_spareResourceLocks.contains(resourceId)) { |
| 458 m_spareResourceLocks.erase(resourceId); | 452 m_spareResourceLocks.erase(resourceId); |
| 459 return; | 453 return; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 472 | 466 |
| 473 void OffscreenCanvasFrameDispatcherImpl::reshape(int width, int height) { | 467 void OffscreenCanvasFrameDispatcherImpl::reshape(int width, int height) { |
| 474 if (m_width != width || m_height != height) { | 468 if (m_width != width || m_height != height) { |
| 475 m_width = width; | 469 m_width = width; |
| 476 m_height = height; | 470 m_height = height; |
| 477 m_changeSizeForNextCommit = true; | 471 m_changeSizeForNextCommit = true; |
| 478 } | 472 } |
| 479 } | 473 } |
| 480 | 474 |
| 481 } // namespace blink | 475 } // namespace blink |
| OLD | NEW |