OLD | NEW |
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 Loading... |
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 Loading... |
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) |
OLD | NEW |