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 17 matching lines...) Expand all Loading... |
28 #include "ui/gfx/transform.h" | 28 #include "ui/gfx/transform.h" |
29 #include "wtf/typed_arrays/ArrayBuffer.h" | 29 #include "wtf/typed_arrays/ArrayBuffer.h" |
30 #include "wtf/typed_arrays/Uint8Array.h" | 30 #include "wtf/typed_arrays/Uint8Array.h" |
31 | 31 |
32 namespace blink { | 32 namespace blink { |
33 | 33 |
34 OffscreenCanvasFrameDispatcherImpl::OffscreenCanvasFrameDispatcherImpl( | 34 OffscreenCanvasFrameDispatcherImpl::OffscreenCanvasFrameDispatcherImpl( |
35 uint32_t clientId, | 35 uint32_t clientId, |
36 uint32_t sinkId, | 36 uint32_t sinkId, |
37 uint32_t localId, | 37 uint32_t localId, |
38 uint64_t nonce, | 38 uint64_t nonceHigh, |
| 39 uint64_t nonceLow, |
39 int width, | 40 int width, |
40 int height) | 41 int height) |
41 : m_surfaceId(cc::FrameSinkId(clientId, sinkId), | 42 : m_surfaceId( |
42 cc::LocalFrameId(localId, nonce)), | 43 cc::FrameSinkId(clientId, sinkId), |
| 44 cc::LocalFrameId( |
| 45 localId, |
| 46 base::UnguessableToken::Deserialize(nonceHigh, nonceLow))), |
43 m_width(width), | 47 m_width(width), |
44 m_height(height), | 48 m_height(height), |
45 m_nextResourceId(1u), | 49 m_nextResourceId(1u), |
46 m_binding(this) { | 50 m_binding(this) { |
47 DCHECK(!m_sink.is_bound()); | 51 DCHECK(!m_sink.is_bound()); |
48 mojom::blink::OffscreenCanvasCompositorFrameSinkProviderPtr provider; | 52 mojom::blink::OffscreenCanvasCompositorFrameSinkProviderPtr provider; |
49 Platform::current()->interfaceProvider()->getInterface( | 53 Platform::current()->interfaceProvider()->getInterface( |
50 mojo::GetProxy(&provider)); | 54 mojo::GetProxy(&provider)); |
51 provider->CreateCompositorFrameSink(m_surfaceId, | 55 provider->CreateCompositorFrameSink(m_surfaceId, |
52 m_binding.CreateInterfacePtrAndBind(), | 56 m_binding.CreateInterfacePtrAndBind(), |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 } | 243 } |
240 | 244 |
241 bool OffscreenCanvasFrameDispatcherImpl::verifyImageSize( | 245 bool OffscreenCanvasFrameDispatcherImpl::verifyImageSize( |
242 const sk_sp<SkImage>& image) { | 246 const sk_sp<SkImage>& image) { |
243 if (image && image->width() == m_width && image->height() == m_height) | 247 if (image && image->width() == m_width && image->height() == m_height) |
244 return true; | 248 return true; |
245 return false; | 249 return false; |
246 } | 250 } |
247 | 251 |
248 } // namespace blink | 252 } // namespace blink |
OLD | NEW |