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

Side by Side Diff: cc/output/output_surface.cc

Issue 145313006: [#7] Pass gfx structs by const ref (gfx::Size) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 10 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/output/output_surface.h ('k') | cc/output/shader.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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/output/output_surface.h" 5 #include "cc/output/output_surface.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 software_device_->EnsureBackbuffer(); 348 software_device_->EnsureBackbuffer();
349 } 349 }
350 350
351 void OutputSurface::DiscardBackbuffer() { 351 void OutputSurface::DiscardBackbuffer() {
352 if (context_provider_) 352 if (context_provider_)
353 context_provider_->ContextGL()->DiscardBackbufferCHROMIUM(); 353 context_provider_->ContextGL()->DiscardBackbufferCHROMIUM();
354 if (software_device_) 354 if (software_device_)
355 software_device_->DiscardBackbuffer(); 355 software_device_->DiscardBackbuffer();
356 } 356 }
357 357
358 void OutputSurface::Reshape(gfx::Size size, float scale_factor) { 358 void OutputSurface::Reshape(const gfx::Size& size, float scale_factor) {
359 if (size == surface_size_ && scale_factor == device_scale_factor_) 359 if (size == surface_size_ && scale_factor == device_scale_factor_)
360 return; 360 return;
361 361
362 surface_size_ = size; 362 surface_size_ = size;
363 device_scale_factor_ = scale_factor; 363 device_scale_factor_ = scale_factor;
364 if (context_provider_) { 364 if (context_provider_) {
365 context_provider_->ContextGL()->ResizeCHROMIUM( 365 context_provider_->ContextGL()->ResizeCHROMIUM(
366 size.width(), size.height(), scale_factor); 366 size.width(), size.height(), scale_factor);
367 } 367 }
368 if (software_device_) 368 if (software_device_)
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
483 TRACE_EVENT1("cc", "OutputSurface::SetMemoryPolicy", 483 TRACE_EVENT1("cc", "OutputSurface::SetMemoryPolicy",
484 "bytes_limit_when_visible", policy.bytes_limit_when_visible); 484 "bytes_limit_when_visible", policy.bytes_limit_when_visible);
485 // Just ignore the memory manager when it says to set the limit to zero 485 // Just ignore the memory manager when it says to set the limit to zero
486 // bytes. This will happen when the memory manager thinks that the renderer 486 // bytes. This will happen when the memory manager thinks that the renderer
487 // is not visible (which the renderer knows better). 487 // is not visible (which the renderer knows better).
488 if (policy.bytes_limit_when_visible) 488 if (policy.bytes_limit_when_visible)
489 client_->SetMemoryPolicy(policy); 489 client_->SetMemoryPolicy(policy);
490 } 490 }
491 491
492 } // namespace cc 492 } // namespace cc
OLDNEW
« no previous file with comments | « cc/output/output_surface.h ('k') | cc/output/shader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698