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

Unified Diff: android_webview/browser/surfaces_instance.cc

Issue 2848223003: Enforce constant size and device scale factor for surfaces (Closed)
Patch Set: Address comments 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..f89c1dc72221f2d04afb138705de3a48cdc28467 100644
--- a/android_webview/browser/surfaces_instance.cc
+++ b/android_webview/browser/surfaces_instance.cc
@@ -139,6 +139,7 @@ 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_) {
@@ -146,7 +147,8 @@ void SurfacesInstance::DrawAndSwap(const gfx::Size& viewport,
surface_size_ = frame_size;
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