| 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 12 matching lines...) Expand all Loading... |
| 23 ImageTransportSurface::~ImageTransportSurface() {} | 23 ImageTransportSurface::~ImageTransportSurface() {} |
| 24 | 24 |
| 25 void ImageTransportSurface::OnSetFrontSurfaceIsProtected( | 25 void ImageTransportSurface::OnSetFrontSurfaceIsProtected( |
| 26 bool is_protected, uint32 protection_state_id) { | 26 bool is_protected, uint32 protection_state_id) { |
| 27 } | 27 } |
| 28 | 28 |
| 29 void ImageTransportSurface::GetRegionsToCopy( | 29 void ImageTransportSurface::GetRegionsToCopy( |
| 30 const gfx::Rect& previous_damage_rect, | 30 const gfx::Rect& previous_damage_rect, |
| 31 const gfx::Rect& new_damage_rect, | 31 const gfx::Rect& new_damage_rect, |
| 32 std::vector<gfx::Rect>* regions) { | 32 std::vector<gfx::Rect>* regions) { |
| 33 gfx::Rect intersection = previous_damage_rect.Intersect(new_damage_rect); | 33 gfx::Rect intersection = previous_damage_rect; |
| 34 intersection.Intersect(new_damage_rect); |
| 34 | 35 |
| 35 if (intersection.IsEmpty()) { | 36 if (intersection.IsEmpty()) { |
| 36 regions->push_back(previous_damage_rect); | 37 regions->push_back(previous_damage_rect); |
| 37 return; | 38 return; |
| 38 } | 39 } |
| 39 | 40 |
| 40 // Top (above the intersection). | 41 // Top (above the intersection). |
| 41 regions->push_back(gfx::Rect(previous_damage_rect.x(), | 42 regions->push_back(gfx::Rect(previous_damage_rect.x(), |
| 42 previous_damage_rect.y(), | 43 previous_damage_rect.y(), |
| 43 previous_damage_rect.width(), | 44 previous_damage_rect.width(), |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 } | 332 } |
| 332 } | 333 } |
| 333 | 334 |
| 334 gfx::Size PassThroughImageTransportSurface::GetSize() { | 335 gfx::Size PassThroughImageTransportSurface::GetSize() { |
| 335 return GLSurfaceAdapter::GetSize(); | 336 return GLSurfaceAdapter::GetSize(); |
| 336 } | 337 } |
| 337 | 338 |
| 338 PassThroughImageTransportSurface::~PassThroughImageTransportSurface() {} | 339 PassThroughImageTransportSurface::~PassThroughImageTransportSurface() {} |
| 339 | 340 |
| 340 #endif // defined(ENABLE_GPU) | 341 #endif // defined(ENABLE_GPU) |
| OLD | NEW |