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

Side by Side Diff: android_webview/browser/hardware_renderer.cc

Issue 2101623002: Remove DelegatedFrameData::device_scale_factor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix fuzzer Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | cc/ipc/cc_param_traits.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/hardware_renderer.h" 5 #include "android_webview/browser/hardware_renderer.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "android_webview/browser/aw_gl_surface.h" 9 #include "android_webview/browser/aw_gl_surface.h"
10 #include "android_webview/browser/aw_render_thread_context_provider.h" 10 #include "android_webview/browser/aw_render_thread_context_provider.h"
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 surface_factory_.reset(); 146 surface_factory_.reset();
147 compositor_id_ = child_frame_->compositor_id; 147 compositor_id_ = child_frame_->compositor_id;
148 last_submitted_output_surface_id_ = child_frame_->output_surface_id; 148 last_submitted_output_surface_id_ = child_frame_->output_surface_id;
149 surface_factory_.reset( 149 surface_factory_.reset(
150 new cc::SurfaceFactory(surface_manager_.get(), this)); 150 new cc::SurfaceFactory(surface_manager_.get(), this));
151 } 151 }
152 152
153 std::unique_ptr<cc::CompositorFrame> child_compositor_frame = 153 std::unique_ptr<cc::CompositorFrame> child_compositor_frame =
154 std::move(child_frame_->frame); 154 std::move(child_frame_->frame);
155 155
156 // On Android we put our browser layers in physical pixels and set our
157 // browser CC device_scale_factor to 1, so suppress the transform between
158 // DIP and pixels.
159 child_compositor_frame->delegated_frame_data->device_scale_factor = 1.0f;
160
161 gfx::Size frame_size = 156 gfx::Size frame_size =
162 child_compositor_frame->delegated_frame_data->render_pass_list.back() 157 child_compositor_frame->delegated_frame_data->render_pass_list.back()
163 ->output_rect.size(); 158 ->output_rect.size();
164 bool size_changed = frame_size != frame_size_; 159 bool size_changed = frame_size != frame_size_;
165 frame_size_ = frame_size; 160 frame_size_ = frame_size;
166 if (child_id_.is_null() || size_changed) { 161 if (child_id_.is_null() || size_changed) {
167 if (!child_id_.is_null()) 162 if (!child_id_.is_null())
168 surface_factory_->Destroy(child_id_); 163 surface_factory_->Destroy(child_id_);
169 child_id_ = surface_id_allocator_->GenerateId(); 164 child_id_ = surface_id_allocator_->GenerateId();
170 surface_factory_->Create(child_id_); 165 surface_factory_->Create(child_id_);
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 const cc::ReturnedResourceArray& resources, 267 const cc::ReturnedResourceArray& resources,
273 const CompositorID& compositor_id, 268 const CompositorID& compositor_id,
274 uint32_t output_surface_id) { 269 uint32_t output_surface_id) {
275 if (output_surface_id != last_committed_output_surface_id_) 270 if (output_surface_id != last_committed_output_surface_id_)
276 return; 271 return;
277 render_thread_manager_->InsertReturnedResourcesOnRT(resources, compositor_id, 272 render_thread_manager_->InsertReturnedResourcesOnRT(resources, compositor_id,
278 output_surface_id); 273 output_surface_id);
279 } 274 }
280 275
281 } // namespace android_webview 276 } // namespace android_webview
OLDNEW
« no previous file with comments | « no previous file | cc/ipc/cc_param_traits.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698