| 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" |
| 11 #include "cc/quads/solid_color_draw_quad.h" | 11 #include "cc/quads/solid_color_draw_quad.h" |
| 12 #include "cc/quads/texture_draw_quad.h" | 12 #include "cc/quads/texture_draw_quad.h" |
| 13 #include "cc/resources/returned_resource.h" | 13 #include "cc/resources/returned_resource.h" |
| 14 #include "platform/RuntimeEnabledFeatures.h" | 14 #include "platform/RuntimeEnabledFeatures.h" |
| 15 #include "public/platform/InterfaceProvider.h" | 15 #include "public/platform/InterfaceProvider.h" |
| 16 #include "public/platform/Platform.h" | 16 #include "public/platform/Platform.h" |
| 17 #include "public/platform/modules/offscreencanvas/offscreen_canvas_surface.mojom
-blink.h" | 17 #include "public/platform/modules/offscreencanvas/offscreen_canvas_surface.mojom
-blink.h" |
| 18 #include "third_party/khronos/GLES2/gl2.h" | 18 #include "third_party/khronos/GLES2/gl2.h" |
| 19 #include "third_party/skia/include/core/SkColor.h" | 19 #include "third_party/skia/include/core/SkColor.h" |
| 20 #include "third_party/skia/include/core/SkImage.h" | 20 #include "third_party/skia/include/core/SkImage.h" |
| 21 #include "third_party/skia/include/core/SkXfermode.h" | 21 #include "third_party/skia/include/core/SkXfermode.h" |
| 22 #include "ui/gfx/geometry/rect.h" | 22 #include "ui/gfx/geometry/rect.h" |
| 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 sinkId, |
| 29 uint32_t localId, | 30 uint32_t localId, |
| 30 uint64_t nonce, | 31 uint64_t nonce, |
| 31 int width, | 32 int width, |
| 32 int height) | 33 int height) |
| 33 : m_surfaceId(cc::FrameSinkId(clientId, 0 /* sink_id */), localId, nonce), | 34 : m_surfaceId(cc::FrameSinkId(clientId, sinkId), localId, nonce), |
| 34 m_width(width), | 35 m_width(width), |
| 35 m_height(height), | 36 m_height(height), |
| 36 m_nextResourceId(1u), | 37 m_nextResourceId(1u), |
| 37 m_binding(this) { | 38 m_binding(this) { |
| 38 DCHECK(!m_sink.is_bound()); | 39 DCHECK(!m_sink.is_bound()); |
| 39 mojom::blink::OffscreenCanvasCompositorFrameSinkProviderPtr provider; | 40 mojom::blink::OffscreenCanvasCompositorFrameSinkProviderPtr provider; |
| 40 Platform::current()->interfaceProvider()->getInterface( | 41 Platform::current()->interfaceProvider()->getInterface( |
| 41 mojo::GetProxy(&provider)); | 42 mojo::GetProxy(&provider)); |
| 42 provider->CreateCompositorFrameSink(m_surfaceId, | 43 provider->CreateCompositorFrameSink(m_surfaceId, |
| 43 m_binding.CreateInterfacePtrAndBind(), | 44 m_binding.CreateInterfacePtrAndBind(), |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 } | 137 } |
| 137 | 138 |
| 138 bool OffscreenCanvasFrameDispatcherImpl::verifyImageSize( | 139 bool OffscreenCanvasFrameDispatcherImpl::verifyImageSize( |
| 139 const sk_sp<SkImage>& image) { | 140 const sk_sp<SkImage>& image) { |
| 140 if (image && image->width() == m_width && image->height() == m_height) | 141 if (image && image->width() == m_width && image->height() == m_height) |
| 141 return true; | 142 return true; |
| 142 return false; | 143 return false; |
| 143 } | 144 } |
| 144 | 145 |
| 145 } // namespace blink | 146 } // namespace blink |
| OLD | NEW |