| 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 "content/browser/renderer_host/offscreen_canvas_surface_impl.h" | 5 #include "content/browser/renderer_host/offscreen_canvas_surface_impl.h" |
| 6 | 6 |
| 7 #include "base/bind_helpers.h" | 7 #include "base/bind_helpers.h" |
| 8 #include "cc/surfaces/surface.h" | 8 #include "cc/surfaces/surface.h" |
| 9 #include "cc/surfaces/surface_manager.h" | 9 #include "cc/surfaces/surface_manager.h" |
| 10 #include "content/browser/compositor/surface_utils.h" | 10 #include "content/browser/compositor/surface_utils.h" |
| 11 #include "content/public/browser/browser_thread.h" | 11 #include "content/public/browser/browser_thread.h" |
| 12 #include "mojo/public/cpp/bindings/strong_binding.h" | 12 #include "mojo/public/cpp/bindings/strong_binding.h" |
| 13 | 13 |
| 14 namespace content { | 14 namespace content { |
| 15 | 15 |
| 16 OffscreenCanvasSurfaceImpl::OffscreenCanvasSurfaceImpl() | 16 OffscreenCanvasSurfaceImpl::OffscreenCanvasSurfaceImpl() |
| 17 : id_allocator_(new cc::SurfaceIdAllocator(AllocateSurfaceClientId())) {} | 17 : id_allocator_(new cc::SurfaceIdAllocator(AllocateFrameSinkId())) {} |
| 18 | 18 |
| 19 OffscreenCanvasSurfaceImpl::~OffscreenCanvasSurfaceImpl() {} | 19 OffscreenCanvasSurfaceImpl::~OffscreenCanvasSurfaceImpl() {} |
| 20 | 20 |
| 21 // static | 21 // static |
| 22 void OffscreenCanvasSurfaceImpl::Create( | 22 void OffscreenCanvasSurfaceImpl::Create( |
| 23 mojo::InterfaceRequest<blink::mojom::OffscreenCanvasSurface> request) { | 23 mojo::InterfaceRequest<blink::mojom::OffscreenCanvasSurface> request) { |
| 24 mojo::MakeStrongBinding(base::MakeUnique<OffscreenCanvasSurfaceImpl>(), | 24 mojo::MakeStrongBinding(base::MakeUnique<OffscreenCanvasSurfaceImpl>(), |
| 25 std::move(request)); | 25 std::move(request)); |
| 26 } | 26 } |
| 27 | 27 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 42 DLOG(ERROR) << "Attempting to require callback on nonexistent surface"; | 42 DLOG(ERROR) << "Attempting to require callback on nonexistent surface"; |
| 43 return; | 43 return; |
| 44 } | 44 } |
| 45 surface->AddDestructionDependency(sequence); | 45 surface->AddDestructionDependency(sequence); |
| 46 } | 46 } |
| 47 | 47 |
| 48 void OffscreenCanvasSurfaceImpl::Satisfy(const cc::SurfaceSequence& sequence) { | 48 void OffscreenCanvasSurfaceImpl::Satisfy(const cc::SurfaceSequence& sequence) { |
| 49 std::vector<uint32_t> sequences; | 49 std::vector<uint32_t> sequences; |
| 50 sequences.push_back(sequence.sequence); | 50 sequences.push_back(sequence.sequence); |
| 51 cc::SurfaceManager* manager = GetSurfaceManager(); | 51 cc::SurfaceManager* manager = GetSurfaceManager(); |
| 52 manager->DidSatisfySequences(sequence.client_id, &sequences); | 52 manager->DidSatisfySequences(sequence.frame_sink_id, &sequences); |
| 53 } | 53 } |
| 54 | 54 |
| 55 } // namespace content | 55 } // namespace content |
| OLD | NEW |