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 "content/renderer/pepper/pepper_plugin_instance_impl.h" | 5 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bit_cast.h" | 10 #include "base/bit_cast.h" |
(...skipping 1267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1278 container_->pageZoomFactor() * container_->pageScaleFactor(); | 1278 container_->pageZoomFactor() * container_->pageScaleFactor(); |
1279 blink::WebFloatRect windowToViewportScale(0, 0, 1.0f, 0); | 1279 blink::WebFloatRect windowToViewportScale(0, 0, 1.0f, 0); |
1280 render_frame()->GetRenderWidget()->convertWindowToViewport( | 1280 render_frame()->GetRenderWidget()->convertWindowToViewport( |
1281 &windowToViewportScale); | 1281 &windowToViewportScale); |
1282 viewport_to_dip_scale_ = 1.0f / windowToViewportScale.width; | 1282 viewport_to_dip_scale_ = 1.0f / windowToViewportScale.width; |
1283 ConvertRectToDIP(&view_data_.rect); | 1283 ConvertRectToDIP(&view_data_.rect); |
1284 ConvertRectToDIP(&view_data_.clip_rect); | 1284 ConvertRectToDIP(&view_data_.clip_rect); |
1285 view_data_.css_scale *= viewport_to_dip_scale_; | 1285 view_data_.css_scale *= viewport_to_dip_scale_; |
1286 view_data_.device_scale /= viewport_to_dip_scale_; | 1286 view_data_.device_scale /= viewport_to_dip_scale_; |
1287 | 1287 |
1288 gfx::Size scroll_offset = | 1288 gfx::Size scroll_offset = gfx::ScaleToRoundedSize( |
1289 container_->document().frame()->scrollOffset(); | 1289 container_->document().frame()->scrollOffset(), viewport_to_dip_scale_); |
| 1290 |
1290 view_data_.scroll_offset = PP_MakePoint(scroll_offset.width(), | 1291 view_data_.scroll_offset = PP_MakePoint(scroll_offset.width(), |
1291 scroll_offset.height()); | 1292 scroll_offset.height()); |
1292 | 1293 |
1293 if (desired_fullscreen_state_ || view_data_.is_fullscreen) { | 1294 if (desired_fullscreen_state_ || view_data_.is_fullscreen) { |
1294 WebElement element = container_->element(); | 1295 WebElement element = container_->element(); |
1295 WebDocument document = element.document(); | 1296 WebDocument document = element.document(); |
1296 bool is_fullscreen_element = (element == document.fullScreenElement()); | 1297 bool is_fullscreen_element = (element == document.fullScreenElement()); |
1297 if (!view_data_.is_fullscreen && desired_fullscreen_state_ && | 1298 if (!view_data_.is_fullscreen && desired_fullscreen_state_ && |
1298 render_frame()->GetRenderWidget()->is_fullscreen_granted() && | 1299 render_frame()->GetRenderWidget()->is_fullscreen_granted() && |
1299 is_fullscreen_element) { | 1300 is_fullscreen_element) { |
(...skipping 2109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3409 const cc::TextureMailbox& mailbox) const { | 3410 const cc::TextureMailbox& mailbox) const { |
3410 auto it = | 3411 auto it = |
3411 std::find_if(texture_ref_counts_.begin(), texture_ref_counts_.end(), | 3412 std::find_if(texture_ref_counts_.begin(), texture_ref_counts_.end(), |
3412 [&mailbox](const TextureMailboxRefCount& ref_count) { | 3413 [&mailbox](const TextureMailboxRefCount& ref_count) { |
3413 return ref_count.first.mailbox() == mailbox.mailbox(); | 3414 return ref_count.first.mailbox() == mailbox.mailbox(); |
3414 }); | 3415 }); |
3415 return it != texture_ref_counts_.end(); | 3416 return it != texture_ref_counts_.end(); |
3416 } | 3417 } |
3417 | 3418 |
3418 } // namespace content | 3419 } // namespace content |
OLD | NEW |