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/browser_plugin/browser_plugin.h" | 5 #include "content/renderer/browser_plugin/browser_plugin.h" |
6 | 6 |
7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #if defined (OS_WIN) | 9 #if defined (OS_WIN) |
10 #include "base/sys_info.h" | 10 #include "base/sys_info.h" |
(...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
750 const WebVector<WebRect>& cut_outs_rects, | 750 const WebVector<WebRect>& cut_outs_rects, |
751 bool is_visible) { | 751 bool is_visible) { |
752 int old_width = width(); | 752 int old_width = width(); |
753 int old_height = height(); | 753 int old_height = height(); |
754 plugin_rect_ = window_rect; | 754 plugin_rect_ = window_rect; |
755 if (auto_size_ || (old_width == window_rect.width && | 755 if (auto_size_ || (old_width == window_rect.width && |
756 old_height == window_rect.height)) { | 756 old_height == window_rect.height)) { |
757 return; | 757 return; |
758 } | 758 } |
759 | 759 |
760 const size_t stride = skia::PlatformCanvas::StrideForWidth(window_rect.width); | 760 const size_t stride = skia::PlatformCanvasStrideForWidth(window_rect.width); |
761 // Make sure the size of the damage buffer is at least four bytes so that we | 761 // Make sure the size of the damage buffer is at least four bytes so that we |
762 // can fit in a magic word to verify that the memory is shared correctly. | 762 // can fit in a magic word to verify that the memory is shared correctly. |
763 size_t size = | 763 size_t size = |
764 std::max(sizeof(unsigned int), | 764 std::max(sizeof(unsigned int), |
765 static_cast<size_t>(window_rect.height * | 765 static_cast<size_t>(window_rect.height * |
766 stride * | 766 stride * |
767 GetDeviceScaleFactor() * | 767 GetDeviceScaleFactor() * |
768 GetDeviceScaleFactor())); | 768 GetDeviceScaleFactor())); |
769 | 769 |
770 // Don't drop the old damage buffer until after we've made sure that the | 770 // Don't drop the old damage buffer until after we've made sure that the |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
954 void* notify_data) { | 954 void* notify_data) { |
955 } | 955 } |
956 | 956 |
957 void BrowserPlugin::didFailLoadingFrameRequest( | 957 void BrowserPlugin::didFailLoadingFrameRequest( |
958 const WebKit::WebURL& url, | 958 const WebKit::WebURL& url, |
959 void* notify_data, | 959 void* notify_data, |
960 const WebKit::WebURLError& error) { | 960 const WebKit::WebURLError& error) { |
961 } | 961 } |
962 | 962 |
963 } // namespace content | 963 } // namespace content |
OLD | NEW |