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/browser/renderer_host/render_widget_host_impl.h" | 5 #include "content/browser/renderer_host/render_widget_host_impl.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 #include <set> | 8 #include <set> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 1619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1630 GetProcess()->ReceivedBadMessage(); | 1630 GetProcess()->ReceivedBadMessage(); |
1631 return; | 1631 return; |
1632 } | 1632 } |
1633 | 1633 |
1634 DCHECK(bitmap->pixels()); | 1634 DCHECK(bitmap->pixels()); |
1635 | 1635 |
1636 SkImageInfo info = SkImageInfo::MakeN32Premul(size.width(), size.height()); | 1636 SkImageInfo info = SkImageInfo::MakeN32Premul(size.width(), size.height()); |
1637 SkBitmap zoomed_bitmap; | 1637 SkBitmap zoomed_bitmap; |
1638 zoomed_bitmap.installPixels(info, bitmap->pixels(), info.minRowBytes()); | 1638 zoomed_bitmap.installPixels(info, bitmap->pixels(), info.minRowBytes()); |
1639 | 1639 |
1640 #if defined(OS_ANDROID) | 1640 #if defined(OS_ANDROID) || defined(OS_WIN) |
| 1641 // Note that |rect| is in coordinates of pixels relative to the window origin. |
| 1642 // Aura-based systems will want to convert this to DIPs. |
1641 if (view_) | 1643 if (view_) |
1642 view_->ShowDisambiguationPopup(rect, zoomed_bitmap); | 1644 view_->ShowDisambiguationPopup(rect, zoomed_bitmap); |
1643 #else | 1645 #else |
1644 NOTIMPLEMENTED(); | 1646 NOTIMPLEMENTED(); |
1645 #endif | 1647 #endif |
1646 | 1648 |
| 1649 // It is assumed that the disambiguation popup will make a copy of the |
| 1650 // provided zoomed image, so we delete this one. |
1647 zoomed_bitmap.setPixels(0); | 1651 zoomed_bitmap.setPixels(0); |
1648 Send(new ViewMsg_ReleaseDisambiguationPopupBitmap(GetRoutingID(), id)); | 1652 Send(new ViewMsg_ReleaseDisambiguationPopupBitmap(GetRoutingID(), id)); |
1649 } | 1653 } |
1650 | 1654 |
1651 #if defined(OS_WIN) | 1655 #if defined(OS_WIN) |
1652 void RenderWidgetHostImpl::OnWindowlessPluginDummyWindowCreated( | 1656 void RenderWidgetHostImpl::OnWindowlessPluginDummyWindowCreated( |
1653 gfx::NativeViewId dummy_activation_window) { | 1657 gfx::NativeViewId dummy_activation_window) { |
1654 HWND hwnd = reinterpret_cast<HWND>(dummy_activation_window); | 1658 HWND hwnd = reinterpret_cast<HWND>(dummy_activation_window); |
1655 | 1659 |
1656 // This may happen as a result of a race condition when the plugin is going | 1660 // This may happen as a result of a race condition when the plugin is going |
(...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2252 } | 2256 } |
2253 #endif | 2257 #endif |
2254 | 2258 |
2255 SkColorType RenderWidgetHostImpl::PreferredReadbackFormat() { | 2259 SkColorType RenderWidgetHostImpl::PreferredReadbackFormat() { |
2256 if (view_) | 2260 if (view_) |
2257 return view_->PreferredReadbackFormat(); | 2261 return view_->PreferredReadbackFormat(); |
2258 return kN32_SkColorType; | 2262 return kN32_SkColorType; |
2259 } | 2263 } |
2260 | 2264 |
2261 } // namespace content | 2265 } // namespace content |
OLD | NEW |