| 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 "android_webview/browser/surfaces_instance.h" | 5 #include "android_webview/browser/surfaces_instance.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "android_webview/browser/aw_gl_surface.h" | 10 #include "android_webview/browser/aw_gl_surface.h" |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 | 135 |
| 136 if (root_id_.is_null()) { | 136 if (root_id_.is_null()) { |
| 137 root_id_ = surface_id_allocator_->GenerateId(); | 137 root_id_ = surface_id_allocator_->GenerateId(); |
| 138 surface_factory_->Create(root_id_); | 138 surface_factory_->Create(root_id_); |
| 139 display_->SetSurfaceId(root_id_, 1.f); | 139 display_->SetSurfaceId(root_id_, 1.f); |
| 140 } | 140 } |
| 141 surface_factory_->SubmitCompositorFrame(root_id_, std::move(frame), | 141 surface_factory_->SubmitCompositorFrame(root_id_, std::move(frame), |
| 142 cc::SurfaceFactory::DrawCallback()); | 142 cc::SurfaceFactory::DrawCallback()); |
| 143 | 143 |
| 144 display_->Resize(viewport); | 144 display_->Resize(viewport); |
| 145 display_->SetExternalClip(clip); | |
| 146 display_->DrawAndSwap(); | 145 display_->DrawAndSwap(); |
| 147 } | 146 } |
| 148 | 147 |
| 149 void SurfacesInstance::AddChildId(const cc::SurfaceId& child_id) { | 148 void SurfacesInstance::AddChildId(const cc::SurfaceId& child_id) { |
| 150 DCHECK(std::find(child_ids_.begin(), child_ids_.end(), child_id) == | 149 DCHECK(std::find(child_ids_.begin(), child_ids_.end(), child_id) == |
| 151 child_ids_.end()); | 150 child_ids_.end()); |
| 152 child_ids_.push_back(child_id); | 151 child_ids_.push_back(child_id); |
| 153 if (!root_id_.is_null()) | 152 if (!root_id_.is_null()) |
| 154 SetEmptyRootFrame(); | 153 SetEmptyRootFrame(); |
| 155 } | 154 } |
| (...skipping 21 matching lines...) Expand all Loading... |
| 177 CHECK(resources.empty()); | 176 CHECK(resources.empty()); |
| 178 } | 177 } |
| 179 | 178 |
| 180 void SurfacesInstance::SetBeginFrameSource( | 179 void SurfacesInstance::SetBeginFrameSource( |
| 181 cc::BeginFrameSource* begin_frame_source) { | 180 cc::BeginFrameSource* begin_frame_source) { |
| 182 // Parent compsitor calls DrawAndSwap directly and doesn't use | 181 // Parent compsitor calls DrawAndSwap directly and doesn't use |
| 183 // BeginFrameSource. | 182 // BeginFrameSource. |
| 184 } | 183 } |
| 185 | 184 |
| 186 } // namespace android_webview | 185 } // namespace android_webview |
| OLD | NEW |