OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/browser_plugin/browser_plugin_compositing_helper.h" | 5 #include "content/renderer/browser_plugin/browser_plugin_compositing_helper.h" |
6 | 6 |
7 #include "cc/texture_layer.h" | 7 #include "cc/texture_layer.h" |
8 #include "content/common/browser_plugin_messages.h" | 8 #include "content/common/browser_plugin_messages.h" |
9 #include "content/renderer/render_thread_impl.h" | 9 #include "content/renderer/render_thread_impl.h" |
10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginContainer.h" | 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginContainer.h" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 if (!texture_layer_) | 87 if (!texture_layer_) |
88 return; | 88 return; |
89 | 89 |
90 gfx::RectF uv_rect(0, 0, 1, 1); | 90 gfx::RectF uv_rect(0, 0, 1, 1); |
91 if (!buffer_size_.IsEmpty() && !container_size_.IsEmpty()) { | 91 if (!buffer_size_.IsEmpty() && !container_size_.IsEmpty()) { |
92 uv_rect.set_width(static_cast<float>(container_size_.width()) / | 92 uv_rect.set_width(static_cast<float>(container_size_.width()) / |
93 static_cast<float>(buffer_size_.width())); | 93 static_cast<float>(buffer_size_.width())); |
94 uv_rect.set_height(static_cast<float>(container_size_.height()) / | 94 uv_rect.set_height(static_cast<float>(container_size_.height()) / |
95 static_cast<float>(buffer_size_.height())); | 95 static_cast<float>(buffer_size_.height())); |
96 } | 96 } |
97 texture_layer_->setUVRect(uv_rect); | 97 texture_layer_->setUV(uv_rect.origin(), uv_rect.bottom_right()); |
98 } | 98 } |
99 | 99 |
100 } // namespace content | 100 } // namespace content |
OLD | NEW |