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

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

Issue 11270042: Add non-member non-mutating methods for common gfx::Rect operations. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 8 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 | Annotate | Revision Log
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; 35 gfx::Rect intersection =
36 intersection.Intersect(new_damage_rect); 36 gfx::IntersectRects(previous_damage_rect, new_damage_rect);
37 37
38 if (intersection.IsEmpty()) { 38 if (intersection.IsEmpty()) {
39 regions->push_back(previous_damage_rect); 39 regions->push_back(previous_damage_rect);
40 return; 40 return;
41 } 41 }
42 42
43 // Top (above the intersection). 43 // Top (above the intersection).
44 regions->push_back(gfx::Rect(previous_damage_rect.x(), 44 regions->push_back(gfx::Rect(previous_damage_rect.x(),
45 previous_damage_rect.y(), 45 previous_damage_rect.y(),
46 previous_damage_rect.width(), 46 previous_damage_rect.width(),
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 339
340 gfx::Size PassThroughImageTransportSurface::GetSize() { 340 gfx::Size PassThroughImageTransportSurface::GetSize() {
341 return GLSurfaceAdapter::GetSize(); 341 return GLSurfaceAdapter::GetSize();
342 } 342 }
343 343
344 PassThroughImageTransportSurface::~PassThroughImageTransportSurface() {} 344 PassThroughImageTransportSurface::~PassThroughImageTransportSurface() {}
345 345
346 } // namespace content 346 } // namespace content
347 347
348 #endif // defined(ENABLE_GPU) 348 #endif // defined(ENABLE_GPU)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698