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

Side by Side Diff: content/browser/compositor/delegated_frame_host.cc

Issue 719573003: Explicitly specify contents scale for SurfaceLayer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
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 "content/browser/compositor/delegated_frame_host.h" 5 #include "content/browser/compositor/delegated_frame_host.h"
6 6
7 #include "base/callback_helpers.h" 7 #include "base/callback_helpers.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "cc/output/compositor_frame.h" 9 #include "cc/output/compositor_frame.h"
10 #include "cc/output/compositor_frame_ack.h" 10 #include "cc/output/compositor_frame_ack.h"
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 frame_size_in_dip != current_frame_size_in_dip_) { 400 frame_size_in_dip != current_frame_size_in_dip_) {
401 if (!surface_id_.is_null()) 401 if (!surface_id_.is_null())
402 surface_factory_->Destroy(surface_id_); 402 surface_factory_->Destroy(surface_id_);
403 surface_id_ = id_allocator_->GenerateId(); 403 surface_id_ = id_allocator_->GenerateId();
404 surface_factory_->Create(surface_id_, frame_size); 404 surface_factory_->Create(surface_id_, frame_size);
405 // manager must outlive compositors using it. 405 // manager must outlive compositors using it.
406 client_->GetLayer()->SetShowSurface( 406 client_->GetLayer()->SetShowSurface(
407 surface_id_, 407 surface_id_,
408 base::Bind(&SatisfyCallback, base::Unretained(manager)), 408 base::Bind(&SatisfyCallback, base::Unretained(manager)),
409 base::Bind(&RequireCallback, base::Unretained(manager)), frame_size, 409 base::Bind(&RequireCallback, base::Unretained(manager)), frame_size,
410 frame_size_in_dip); 410 frame_device_scale_factor, frame_size_in_dip);
411 current_surface_size_ = frame_size; 411 current_surface_size_ = frame_size;
412 current_scale_factor_ = frame_device_scale_factor;
412 } 413 }
413 scoped_ptr<cc::CompositorFrame> compositor_frame = 414 scoped_ptr<cc::CompositorFrame> compositor_frame =
414 make_scoped_ptr(new cc::CompositorFrame()); 415 make_scoped_ptr(new cc::CompositorFrame());
415 compositor_frame->delegated_frame_data = frame_data.Pass(); 416 compositor_frame->delegated_frame_data = frame_data.Pass();
416 417
417 compositor_frame->metadata.latency_info.swap(skipped_latency_info_list_); 418 compositor_frame->metadata.latency_info.swap(skipped_latency_info_list_);
418 compositor_frame->metadata.latency_info.insert( 419 compositor_frame->metadata.latency_info.insert(
419 compositor_frame->metadata.latency_info.end(), 420 compositor_frame->metadata.latency_info.end(),
420 latency_info.begin(), 421 latency_info.begin(),
421 latency_info.end()); 422 latency_info.end());
(...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after
1007 if (frame_provider_.get()) { 1008 if (frame_provider_.get()) {
1008 new_layer->SetShowDelegatedContent(frame_provider_.get(), 1009 new_layer->SetShowDelegatedContent(frame_provider_.get(),
1009 current_frame_size_in_dip_); 1010 current_frame_size_in_dip_);
1010 } 1011 }
1011 if (!surface_id_.is_null()) { 1012 if (!surface_id_.is_null()) {
1012 ImageTransportFactory* factory = ImageTransportFactory::GetInstance(); 1013 ImageTransportFactory* factory = ImageTransportFactory::GetInstance();
1013 cc::SurfaceManager* manager = factory->GetSurfaceManager(); 1014 cc::SurfaceManager* manager = factory->GetSurfaceManager();
1014 new_layer->SetShowSurface( 1015 new_layer->SetShowSurface(
1015 surface_id_, base::Bind(&SatisfyCallback, base::Unretained(manager)), 1016 surface_id_, base::Bind(&SatisfyCallback, base::Unretained(manager)),
1016 base::Bind(&RequireCallback, base::Unretained(manager)), 1017 base::Bind(&RequireCallback, base::Unretained(manager)),
1017 current_surface_size_, current_frame_size_in_dip_); 1018 current_surface_size_, current_scale_factor_,
1019 current_frame_size_in_dip_);
1018 } 1020 }
1019 } 1021 }
1020 1022
1021 } // namespace content 1023 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698