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 1660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1671 GetProcess()->ReceivedBadMessage(); | 1671 GetProcess()->ReceivedBadMessage(); |
1672 return; | 1672 return; |
1673 } | 1673 } |
1674 | 1674 |
1675 DCHECK(bitmap->pixels()); | 1675 DCHECK(bitmap->pixels()); |
1676 | 1676 |
1677 SkImageInfo info = SkImageInfo::MakeN32Premul(size.width(), size.height()); | 1677 SkImageInfo info = SkImageInfo::MakeN32Premul(size.width(), size.height()); |
1678 SkBitmap zoomed_bitmap; | 1678 SkBitmap zoomed_bitmap; |
1679 zoomed_bitmap.installPixels(info, bitmap->pixels(), info.minRowBytes()); | 1679 zoomed_bitmap.installPixels(info, bitmap->pixels(), info.minRowBytes()); |
1680 | 1680 |
1681 #if defined(OS_ANDROID) | 1681 #if defined(OS_ANDROID) || defined(OS_WIN) |
sky
2014/08/04 20:05:19
OS_WIN->TOOLKIT_VIEWS
luken
2014/09/11 01:07:27
Done.
| |
1682 // Note that |rect| is in coordinates of pixels relative to the window origin. | |
1683 // Aura-based systems will want to convert this to DIPs. | |
1682 if (view_) | 1684 if (view_) |
1683 view_->ShowDisambiguationPopup(rect, zoomed_bitmap); | 1685 view_->ShowDisambiguationPopup(rect, zoomed_bitmap); |
1684 #else | 1686 #else |
1685 NOTIMPLEMENTED(); | 1687 NOTIMPLEMENTED(); |
1686 #endif | 1688 #endif |
1687 | 1689 |
1690 // It is assumed that the disambiguation popup will make a copy of the | |
1691 // provided zoomed image, so we delete this one. | |
1688 zoomed_bitmap.setPixels(0); | 1692 zoomed_bitmap.setPixels(0); |
sky
2014/08/04 20:05:20
Is this code necessary?
luken
2014/09/11 01:07:27
This code comes from the Android support, which ha
| |
1689 Send(new ViewMsg_ReleaseDisambiguationPopupBitmap(GetRoutingID(), id)); | 1693 Send(new ViewMsg_ReleaseDisambiguationPopupBitmap(GetRoutingID(), id)); |
1690 } | 1694 } |
1691 | 1695 |
1692 #if defined(OS_WIN) | 1696 #if defined(OS_WIN) |
1693 void RenderWidgetHostImpl::OnWindowlessPluginDummyWindowCreated( | 1697 void RenderWidgetHostImpl::OnWindowlessPluginDummyWindowCreated( |
1694 gfx::NativeViewId dummy_activation_window) { | 1698 gfx::NativeViewId dummy_activation_window) { |
1695 HWND hwnd = reinterpret_cast<HWND>(dummy_activation_window); | 1699 HWND hwnd = reinterpret_cast<HWND>(dummy_activation_window); |
1696 | 1700 |
1697 // This may happen as a result of a race condition when the plugin is going | 1701 // This may happen as a result of a race condition when the plugin is going |
1698 // away. | 1702 // away. |
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2302 } | 2306 } |
2303 #endif | 2307 #endif |
2304 | 2308 |
2305 SkColorType RenderWidgetHostImpl::PreferredReadbackFormat() { | 2309 SkColorType RenderWidgetHostImpl::PreferredReadbackFormat() { |
2306 if (view_) | 2310 if (view_) |
2307 return view_->PreferredReadbackFormat(); | 2311 return view_->PreferredReadbackFormat(); |
2308 return kN32_SkColorType; | 2312 return kN32_SkColorType; |
2309 } | 2313 } |
2310 | 2314 |
2311 } // namespace content | 2315 } // namespace content |
OLD | NEW |