| 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 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 | 396 |
| 397 void OffscreenCanvasFrameDispatcherImpl::OnBeginFrame( | 397 void OffscreenCanvasFrameDispatcherImpl::OnBeginFrame( |
| 398 const cc::BeginFrameArgs& beginFrameArgs) { | 398 const cc::BeginFrameArgs& beginFrameArgs) { |
| 399 DCHECK(client()); | 399 DCHECK(client()); |
| 400 client()->beginFrame(); | 400 client()->beginFrame(); |
| 401 } | 401 } |
| 402 | 402 |
| 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.at(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, | 414 const cc::LocalSurfaceId& localSurfaceId, |
| 415 ::gfx::mojom::blink::RectPtr damageRect) { | 415 ::gfx::mojom::blink::RectPtr damageRect) { |
| 416 // TODO(fsamuel, staraz): Implement this. | 416 // TODO(fsamuel, staraz): Implement this. |
| (...skipping 24 matching lines...) Expand all Loading... |
| 441 | 441 |
| 442 void OffscreenCanvasFrameDispatcherImpl::reshape(int width, int height) { | 442 void OffscreenCanvasFrameDispatcherImpl::reshape(int width, int height) { |
| 443 if (m_width != width || m_height != height) { | 443 if (m_width != width || m_height != height) { |
| 444 m_width = width; | 444 m_width = width; |
| 445 m_height = height; | 445 m_height = height; |
| 446 m_changeSizeForNextCommit = true; | 446 m_changeSizeForNextCommit = true; |
| 447 } | 447 } |
| 448 } | 448 } |
| 449 | 449 |
| 450 } // namespace blink | 450 } // namespace blink |
| OLD | NEW |