Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(488)

Unified Diff: android_webview/browser/surfaces_instance.cc

Issue 2900303002: Reland "Enforce constant size and device scale factor for surfaces" with fixes (Closed)
Patch Set: Fixed webview Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « android_webview/browser/hardware_renderer.cc ('k') | android_webview/browser/test/rendering_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/browser/surfaces_instance.cc
diff --git a/android_webview/browser/surfaces_instance.cc b/android_webview/browser/surfaces_instance.cc
index b8599fe91175b5e7f1707cb68f7d8cf789bf212a..a04bf5f5a78017d9cad14fe8a81924f63c7da809 100644
--- a/android_webview/browser/surfaces_instance.cc
+++ b/android_webview/browser/surfaces_instance.cc
@@ -139,14 +139,16 @@ void SurfacesInstance::DrawAndSwap(const gfx::Size& viewport,
frame.metadata.begin_frame_ack =
cc::BeginFrameAck::CreateManualAckWithDamage();
frame.render_pass_list.push_back(std::move(render_pass));
+ frame.metadata.device_scale_factor = 1.f;
frame.metadata.referenced_surfaces = child_ids_;
- if (!root_id_.is_valid() || frame_size != surface_size_) {
+ if (!root_id_.is_valid() || viewport != surface_size_) {
root_id_ = local_surface_id_allocator_->GenerateId();
- surface_size_ = frame_size;
+ surface_size_ = viewport;
display_->SetLocalSurfaceId(root_id_, 1.f);
}
- support_->SubmitCompositorFrame(root_id_, std::move(frame));
+ bool result = support_->SubmitCompositorFrame(root_id_, std::move(frame));
+ DCHECK(result);
display_->Resize(viewport);
display_->DrawAndSwap();
@@ -186,7 +188,9 @@ void SurfacesInstance::SetSolidColorRootFrame() {
frame.metadata.begin_frame_ack =
cc::BeginFrameAck::CreateManualAckWithDamage();
frame.metadata.referenced_surfaces = child_ids_;
- support_->SubmitCompositorFrame(root_id_, std::move(frame));
+ frame.metadata.device_scale_factor = 1;
+ bool result = support_->SubmitCompositorFrame(root_id_, std::move(frame));
+ DCHECK(result);
}
void SurfacesInstance::DidReceiveCompositorFrameAck(
« no previous file with comments | « android_webview/browser/hardware_renderer.cc ('k') | android_webview/browser/test/rendering_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698