| 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/output/delegated_frame_data.h" | 8 #include "cc/output/delegated_frame_data.h" |
| 9 #include "cc/quads/render_pass.h" | 9 #include "cc/quads/render_pass.h" |
| 10 #include "cc/quads/shared_quad_state.h" | 10 #include "cc/quads/shared_quad_state.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 #include "ui/gfx/transform.h" | 23 #include "ui/gfx/transform.h" |
| 24 | 24 |
| 25 namespace blink { | 25 namespace blink { |
| 26 | 26 |
| 27 OffscreenCanvasFrameDispatcherImpl::OffscreenCanvasFrameDispatcherImpl( | 27 OffscreenCanvasFrameDispatcherImpl::OffscreenCanvasFrameDispatcherImpl( |
| 28 uint32_t clientId, | 28 uint32_t clientId, |
| 29 uint32_t localId, | 29 uint32_t localId, |
| 30 uint64_t nonce, | 30 uint64_t nonce, |
| 31 int width, | 31 int width, |
| 32 int height) | 32 int height) |
| 33 : m_surfaceId(cc::SurfaceId(clientId, localId, nonce)), | 33 : m_surfaceId(cc::SurfaceId(cc::FrameSinkId(clientId, 0 /* sink_id */), |
| 34 localId, |
| 35 nonce)), |
| 34 m_width(width), | 36 m_width(width), |
| 35 m_height(height), | 37 m_height(height), |
| 36 m_nextResourceId(1u), | 38 m_nextResourceId(1u), |
| 37 m_binding(this) { | 39 m_binding(this) { |
| 38 DCHECK(!m_sink.is_bound()); | 40 DCHECK(!m_sink.is_bound()); |
| 39 mojom::blink::OffscreenCanvasCompositorFrameSinkProviderPtr provider; | 41 mojom::blink::OffscreenCanvasCompositorFrameSinkProviderPtr provider; |
| 40 Platform::current()->interfaceProvider()->getInterface( | 42 Platform::current()->interfaceProvider()->getInterface( |
| 41 mojo::GetProxy(&provider)); | 43 mojo::GetProxy(&provider)); |
| 42 provider->CreateCompositorFrameSink(m_surfaceId, | 44 provider->CreateCompositorFrameSink(m_surfaceId, |
| 43 m_binding.CreateInterfacePtrAndBind(), | 45 m_binding.CreateInterfacePtrAndBind(), |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 } | 149 } |
| 148 | 150 |
| 149 bool OffscreenCanvasFrameDispatcherImpl::verifyImageSize( | 151 bool OffscreenCanvasFrameDispatcherImpl::verifyImageSize( |
| 150 const sk_sp<SkImage>& image) { | 152 const sk_sp<SkImage>& image) { |
| 151 if (image && image->width() == m_width && image->height() == m_height) | 153 if (image && image->width() == m_width && image->height() == m_height) |
| 152 return true; | 154 return true; |
| 153 return false; | 155 return false; |
| 154 } | 156 } |
| 155 | 157 |
| 156 } // namespace blink | 158 } // namespace blink |
| OLD | NEW |