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

Side by Side Diff: cc/surfaces/display.cc

Issue 1968363002: SurfaceAggregator should check whether output is secure when drawin (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « cc/surfaces/display.h ('k') | cc/surfaces/surface_aggregator.h » ('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 "cc/surfaces/display.h" 5 #include "cc/surfaces/display.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/threading/thread_task_runner_handle.h" 9 #include "base/threading/thread_task_runner_handle.h"
10 #include "base/trace_event/trace_event.h" 10 #include "base/trace_event/trace_event.h"
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 swapped_since_resize_ = false; 142 swapped_since_resize_ = false;
143 current_surface_size_ = size; 143 current_surface_size_ = size;
144 if (scheduler_) 144 if (scheduler_)
145 scheduler_->DisplayResized(); 145 scheduler_->DisplayResized();
146 } 146 }
147 147
148 void Display::SetExternalClip(const gfx::Rect& clip) { 148 void Display::SetExternalClip(const gfx::Rect& clip) {
149 external_clip_ = clip; 149 external_clip_ = clip;
150 } 150 }
151 151
152 void Display::SetOutputIsSecure(bool secure) {
153 if (secure == output_is_secure_)
154 return;
155 output_is_secure_ = secure;
156
157 if (aggregator_) {
158 aggregator_->set_output_is_secure(secure);
159 // Force a redraw.
160 if (!current_surface_id_.is_null())
161 aggregator_->SetFullDamageForSurface(current_surface_id_);
162 }
163 }
164
152 void Display::InitializeRenderer() { 165 void Display::InitializeRenderer() {
153 if (resource_provider_) 166 if (resource_provider_)
154 return; 167 return;
155 168
156 std::unique_ptr<ResourceProvider> resource_provider = 169 std::unique_ptr<ResourceProvider> resource_provider =
157 ResourceProvider::Create( 170 ResourceProvider::Create(
158 output_surface_.get(), bitmap_manager_, gpu_memory_buffer_manager_, 171 output_surface_.get(), bitmap_manager_, gpu_memory_buffer_manager_,
159 nullptr, settings_.highp_threshold_min, 172 nullptr, settings_.highp_threshold_min,
160 settings_.texture_id_allocation_chunk_size, 173 settings_.texture_id_allocation_chunk_size,
161 settings_.use_gpu_memory_buffer_resources, 174 settings_.use_gpu_memory_buffer_resources,
(...skipping 28 matching lines...) Expand all
190 renderer_ = std::move(renderer); 203 renderer_ = std::move(renderer);
191 } 204 }
192 205
193 resource_provider_ = std::move(resource_provider); 206 resource_provider_ = std::move(resource_provider);
194 // TODO(jbauman): Outputting an incomplete quad list doesn't work when using 207 // TODO(jbauman): Outputting an incomplete quad list doesn't work when using
195 // overlays. 208 // overlays.
196 bool output_partial_list = renderer_->Capabilities().using_partial_swap && 209 bool output_partial_list = renderer_->Capabilities().using_partial_swap &&
197 !output_surface_->GetOverlayCandidateValidator(); 210 !output_surface_->GetOverlayCandidateValidator();
198 aggregator_.reset(new SurfaceAggregator( 211 aggregator_.reset(new SurfaceAggregator(
199 surface_manager_, resource_provider_.get(), output_partial_list)); 212 surface_manager_, resource_provider_.get(), output_partial_list));
213 aggregator_->set_output_is_secure(output_is_secure_);
200 } 214 }
201 215
202 void Display::DidLoseOutputSurface() { 216 void Display::DidLoseOutputSurface() {
203 if (scheduler_) 217 if (scheduler_)
204 scheduler_->OutputSurfaceLost(); 218 scheduler_->OutputSurfaceLost();
205 // WARNING: The client may delete the Display in this method call. Do not 219 // WARNING: The client may delete the Display in this method call. Do not
206 // make any additional references to members after this call. 220 // make any additional references to members after this call.
207 client_->OutputSurfaceLost(); 221 client_->OutputSurfaceLost();
208 } 222 }
209 223
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 419
406 if (surface_id == current_surface_id_) 420 if (surface_id == current_surface_id_)
407 UpdateRootSurfaceResourcesLocked(); 421 UpdateRootSurfaceResourcesLocked();
408 } 422 }
409 423
410 SurfaceId Display::CurrentSurfaceId() { 424 SurfaceId Display::CurrentSurfaceId() {
411 return current_surface_id_; 425 return current_surface_id_;
412 } 426 }
413 427
414 } // namespace cc 428 } // namespace cc
OLDNEW
« no previous file with comments | « cc/surfaces/display.h ('k') | cc/surfaces/surface_aggregator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698