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

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

Issue 2129523003: Remove more GpuMemoryBufferId plumbing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
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/renderer_host/delegated_frame_host.h" 5 #include "content/browser/renderer_host/delegated_frame_host.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 if (!surface_factory_) { 454 if (!surface_factory_) {
455 surface_factory_ = 455 surface_factory_ =
456 base::WrapUnique(new cc::SurfaceFactory(manager, this)); 456 base::WrapUnique(new cc::SurfaceFactory(manager, this));
457 } 457 }
458 if (surface_id_.is_null() || frame_size != current_surface_size_ || 458 if (surface_id_.is_null() || frame_size != current_surface_size_ ||
459 frame_size_in_dip != current_frame_size_in_dip_) { 459 frame_size_in_dip != current_frame_size_in_dip_) {
460 if (!surface_id_.is_null()) 460 if (!surface_id_.is_null())
461 surface_factory_->Destroy(surface_id_); 461 surface_factory_->Destroy(surface_id_);
462 surface_id_ = id_allocator_->GenerateId(); 462 surface_id_ = id_allocator_->GenerateId();
463 surface_factory_->Create(surface_id_); 463 surface_factory_->Create(surface_id_);
464 surface_factory_->SetSurfaceGpuMemoryBufferClientId(
465 surface_id_, client_->DelegatedFrameHostGetGpuMemoryBufferClientId());
466 // manager must outlive compositors using it. 464 // manager must outlive compositors using it.
467 client_->DelegatedFrameHostGetLayer()->SetShowSurface( 465 client_->DelegatedFrameHostGetLayer()->SetShowSurface(
468 surface_id_, base::Bind(&SatisfyCallback, base::Unretained(manager)), 466 surface_id_, base::Bind(&SatisfyCallback, base::Unretained(manager)),
469 base::Bind(&RequireCallback, base::Unretained(manager)), frame_size, 467 base::Bind(&RequireCallback, base::Unretained(manager)), frame_size,
470 frame_device_scale_factor, frame_size_in_dip); 468 frame_device_scale_factor, frame_size_in_dip);
471 current_surface_size_ = frame_size; 469 current_surface_size_ = frame_size;
472 current_scale_factor_ = frame_device_scale_factor; 470 current_scale_factor_ = frame_device_scale_factor;
473 } 471 }
474 472
475 frame.metadata.latency_info.insert(frame.metadata.latency_info.end(), 473 frame.metadata.latency_info.insert(frame.metadata.latency_info.end(),
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
895 cc::SurfaceManager* manager = factory->GetSurfaceManager(); 893 cc::SurfaceManager* manager = factory->GetSurfaceManager();
896 new_layer->SetShowSurface( 894 new_layer->SetShowSurface(
897 surface_id_, base::Bind(&SatisfyCallback, base::Unretained(manager)), 895 surface_id_, base::Bind(&SatisfyCallback, base::Unretained(manager)),
898 base::Bind(&RequireCallback, base::Unretained(manager)), 896 base::Bind(&RequireCallback, base::Unretained(manager)),
899 current_surface_size_, current_scale_factor_, 897 current_surface_size_, current_scale_factor_,
900 current_frame_size_in_dip_); 898 current_frame_size_in_dip_);
901 } 899 }
902 } 900 }
903 901
904 } // namespace content 902 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/delegated_frame_host.h ('k') | content/browser/renderer_host/render_widget_host_view_aura.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698