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

Side by Side Diff: content/common/gpu/image_transport_surface.cc

Issue 11110004: Make gfx::Rect class operations consistently mutate the class they are called on. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: cc/ fixes Created 8 years, 2 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #if defined(ENABLE_GPU) 5 #if defined(ENABLE_GPU)
6 6
7 #include "content/common/gpu/image_transport_surface.h" 7 #include "content/common/gpu/image_transport_surface.h"
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 14 matching lines...) Expand all
25 ImageTransportSurface::~ImageTransportSurface() {} 25 ImageTransportSurface::~ImageTransportSurface() {}
26 26
27 void ImageTransportSurface::OnSetFrontSurfaceIsProtected( 27 void ImageTransportSurface::OnSetFrontSurfaceIsProtected(
28 bool is_protected, uint32 protection_state_id) { 28 bool is_protected, uint32 protection_state_id) {
29 } 29 }
30 30
31 void ImageTransportSurface::GetRegionsToCopy( 31 void ImageTransportSurface::GetRegionsToCopy(
32 const gfx::Rect& previous_damage_rect, 32 const gfx::Rect& previous_damage_rect,
33 const gfx::Rect& new_damage_rect, 33 const gfx::Rect& new_damage_rect,
34 std::vector<gfx::Rect>* regions) { 34 std::vector<gfx::Rect>* regions) {
35 gfx::Rect intersection = previous_damage_rect.Intersect(new_damage_rect); 35 gfx::Rect intersection = previous_damage_rect;
36 intersection.Intersect(new_damage_rect);
36 37
37 if (intersection.IsEmpty()) { 38 if (intersection.IsEmpty()) {
38 regions->push_back(previous_damage_rect); 39 regions->push_back(previous_damage_rect);
39 return; 40 return;
40 } 41 }
41 42
42 // Top (above the intersection). 43 // Top (above the intersection).
43 regions->push_back(gfx::Rect(previous_damage_rect.x(), 44 regions->push_back(gfx::Rect(previous_damage_rect.x(),
44 previous_damage_rect.y(), 45 previous_damage_rect.y(),
45 previous_damage_rect.width(), 46 previous_damage_rect.width(),
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 336
336 gfx::Size PassThroughImageTransportSurface::GetSize() { 337 gfx::Size PassThroughImageTransportSurface::GetSize() {
337 return GLSurfaceAdapter::GetSize(); 338 return GLSurfaceAdapter::GetSize();
338 } 339 }
339 340
340 PassThroughImageTransportSurface::~PassThroughImageTransportSurface() {} 341 PassThroughImageTransportSurface::~PassThroughImageTransportSurface() {}
341 342
342 } // namespace content 343 } // namespace content
343 344
344 #endif // defined(ENABLE_GPU) 345 #endif // defined(ENABLE_GPU)
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_win.cc ('k') | content/plugin/webplugin_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698