| 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 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 403 void OffscreenCanvasFrameDispatcherImpl::ReclaimResources( | 403 void OffscreenCanvasFrameDispatcherImpl::ReclaimResources( |
| 404 const cc::ReturnedResourceArray& resources) { | 404 const cc::ReturnedResourceArray& resources) { |
| 405 for (const auto& resource : resources) { | 405 for (const auto& resource : resources) { |
| 406 RefPtr<StaticBitmapImage> image = m_cachedImages.get(resource.id); | 406 RefPtr<StaticBitmapImage> image = m_cachedImages.get(resource.id); |
| 407 if (image) | 407 if (image) |
| 408 image->updateSyncToken(resource.sync_token); | 408 image->updateSyncToken(resource.sync_token); |
| 409 reclaimResource(resource.id); | 409 reclaimResource(resource.id); |
| 410 } | 410 } |
| 411 } | 411 } |
| 412 | 412 |
| 413 void OffscreenCanvasFrameDispatcherImpl::WillDrawSurface() { | 413 void OffscreenCanvasFrameDispatcherImpl::WillDrawSurface( |
| 414 const cc::LocalSurfaceId& localSurfaceId, |
| 415 ::gfx::mojom::blink::RectPtr damageRect) { |
| 414 // TODO(fsamuel, staraz): Implement this. | 416 // TODO(fsamuel, staraz): Implement this. |
| 415 } | 417 } |
| 416 | 418 |
| 417 void OffscreenCanvasFrameDispatcherImpl::reclaimResource(unsigned resourceId) { | 419 void OffscreenCanvasFrameDispatcherImpl::reclaimResource(unsigned resourceId) { |
| 418 // An image resource needs to be returned by both the | 420 // An image resource needs to be returned by both the |
| 419 // CompositorFrameSink and the HTMLCanvasElement. These | 421 // CompositorFrameSink and the HTMLCanvasElement. These |
| 420 // events can happen in any order. The first of the two | 422 // events can happen in any order. The first of the two |
| 421 // to return a given resource will result in the spare | 423 // to return a given resource will result in the spare |
| 422 // resource lock being lifted, and the second will delete | 424 // resource lock being lifted, and the second will delete |
| 423 // the resource for real. | 425 // the resource for real. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 439 | 441 |
| 440 void OffscreenCanvasFrameDispatcherImpl::reshape(int width, int height) { | 442 void OffscreenCanvasFrameDispatcherImpl::reshape(int width, int height) { |
| 441 if (m_width != width || m_height != height) { | 443 if (m_width != width || m_height != height) { |
| 442 m_width = width; | 444 m_width = width; |
| 443 m_height = height; | 445 m_height = height; |
| 444 m_changeSizeForNextCommit = true; | 446 m_changeSizeForNextCommit = true; |
| 445 } | 447 } |
| 446 } | 448 } |
| 447 | 449 |
| 448 } // namespace blink | 450 } // namespace blink |
| OLD | NEW |