| 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 #include "webkit/media/android/webmediaplayer_android.h" | 5 #include "webkit/media/android/webmediaplayer_android.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "cc/layers/video_layer.h" | 10 #include "cc/layers/video_layer.h" |
| (...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 473 } | 473 } |
| 474 | 474 |
| 475 void WebMediaPlayerAndroid::SetNeedsEstablishPeer(bool needs_establish_peer) { | 475 void WebMediaPlayerAndroid::SetNeedsEstablishPeer(bool needs_establish_peer) { |
| 476 needs_establish_peer_ = needs_establish_peer; | 476 needs_establish_peer_ = needs_establish_peer; |
| 477 } | 477 } |
| 478 | 478 |
| 479 void WebMediaPlayerAndroid::UpdatePlayingState(bool is_playing) { | 479 void WebMediaPlayerAndroid::UpdatePlayingState(bool is_playing) { |
| 480 is_playing_ = is_playing; | 480 is_playing_ = is_playing; |
| 481 } | 481 } |
| 482 | 482 |
| 483 bool WebMediaPlayerAndroid::GetGeometryChange(gfx::RectF* rect) { |
| 484 if (!video_weblayer_) |
| 485 return false; |
| 486 |
| 487 // Compute the geometry of video frame layer. |
| 488 cc::Layer* layer = video_weblayer_->layer(); |
| 489 rect->set_size(layer->bounds()); |
| 490 while (layer) { |
| 491 rect->Offset(layer->position().OffsetFromOrigin()); |
| 492 layer = layer->parent(); |
| 493 } |
| 494 |
| 495 // Return false when the geometry hasn't been changed from the last time. |
| 496 if (last_computed_rect_ == *rect) |
| 497 return false; |
| 498 |
| 499 // Store the changed geometry information when it is actually changed. |
| 500 last_computed_rect_ = *rect; |
| 501 return true; |
| 502 } |
| 503 |
| 483 } // namespace webkit_media | 504 } // namespace webkit_media |
| OLD | NEW |