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(cc::FrameSinkId(clientId, 0 /* sink_id */), | 33 : m_surfaceId(cc::FrameSinkId(clientId, 0 /* sink_id */), localId, nonce), |
34 localId, | |
35 nonce)), | |
36 m_width(width), | 34 m_width(width), |
37 m_height(height), | 35 m_height(height), |
38 m_nextResourceId(1u), | 36 m_nextResourceId(1u), |
39 m_binding(this) { | 37 m_binding(this) { |
40 DCHECK(!m_sink.is_bound()); | 38 DCHECK(!m_sink.is_bound()); |
41 mojom::blink::OffscreenCanvasCompositorFrameSinkProviderPtr provider; | 39 mojom::blink::OffscreenCanvasCompositorFrameSinkProviderPtr provider; |
42 Platform::current()->interfaceProvider()->getInterface( | 40 Platform::current()->interfaceProvider()->getInterface( |
43 mojo::GetProxy(&provider)); | 41 mojo::GetProxy(&provider)); |
44 provider->CreateCompositorFrameSink(m_surfaceId, | 42 provider->CreateCompositorFrameSink(m_surfaceId, |
45 m_binding.CreateInterfacePtrAndBind(), | 43 m_binding.CreateInterfacePtrAndBind(), |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 } | 147 } |
150 | 148 |
151 bool OffscreenCanvasFrameDispatcherImpl::verifyImageSize( | 149 bool OffscreenCanvasFrameDispatcherImpl::verifyImageSize( |
152 const sk_sp<SkImage>& image) { | 150 const sk_sp<SkImage>& image) { |
153 if (image && image->width() == m_width && image->height() == m_height) | 151 if (image && image->width() == m_width && image->height() == m_height) |
154 return true; | 152 return true; |
155 return false; | 153 return false; |
156 } | 154 } |
157 | 155 |
158 } // namespace blink | 156 } // namespace blink |
OLD | NEW |