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 <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 if (!current_local_frame_id_.is_valid() || | 50 if (!current_local_frame_id_.is_valid() || |
51 surface_info.id().local_frame_id() != current_local_frame_id_) { | 51 surface_info.id().local_frame_id() != current_local_frame_id_) { |
52 current_local_frame_id_ = surface_info.id().local_frame_id(); | 52 current_local_frame_id_ = surface_info.id().local_frame_id(); |
53 if (client_) | 53 if (client_) |
54 client_->OnSurfaceCreated(surface_info); | 54 client_->OnSurfaceCreated(surface_info); |
55 } | 55 } |
56 } | 56 } |
57 | 57 |
58 void OffscreenCanvasSurfaceImpl::Require(const cc::SurfaceId& surface_id, | 58 void OffscreenCanvasSurfaceImpl::Require(const cc::SurfaceId& surface_id, |
59 const cc::SurfaceSequence& sequence) { | 59 const cc::SurfaceSequence& sequence) { |
60 cc::SurfaceManager* manager = GetSurfaceManager(); | 60 GetSurfaceManager()->RequireSequence(surface_id, sequence); |
61 cc::Surface* surface = manager->GetSurfaceForId(surface_id); | |
62 if (!surface) { | |
63 DLOG(ERROR) << "Attempting to require callback on nonexistent surface"; | |
64 return; | |
65 } | |
66 surface->AddDestructionDependency(sequence); | |
67 } | 61 } |
68 | 62 |
69 void OffscreenCanvasSurfaceImpl::Satisfy(const cc::SurfaceSequence& sequence) { | 63 void OffscreenCanvasSurfaceImpl::Satisfy(const cc::SurfaceSequence& sequence) { |
70 std::vector<uint32_t> sequences; | 64 GetSurfaceManager()->SatisfySequence(sequence); |
71 sequences.push_back(sequence.sequence); | |
72 cc::SurfaceManager* manager = GetSurfaceManager(); | |
73 manager->DidSatisfySequences(sequence.frame_sink_id, &sequences); | |
74 } | 65 } |
75 | 66 |
76 } // namespace content | 67 } // namespace content |
OLD | NEW |