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