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 1668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1679 GetProcess()->ReceivedBadMessage(); | 1679 GetProcess()->ReceivedBadMessage(); |
1680 return; | 1680 return; |
1681 } | 1681 } |
1682 | 1682 |
1683 DCHECK(bitmap->pixels()); | 1683 DCHECK(bitmap->pixels()); |
1684 | 1684 |
1685 SkImageInfo info = SkImageInfo::MakeN32Premul(size.width(), size.height()); | 1685 SkImageInfo info = SkImageInfo::MakeN32Premul(size.width(), size.height()); |
1686 SkBitmap zoomed_bitmap; | 1686 SkBitmap zoomed_bitmap; |
1687 zoomed_bitmap.installPixels(info, bitmap->pixels(), info.minRowBytes()); | 1687 zoomed_bitmap.installPixels(info, bitmap->pixels(), info.minRowBytes()); |
1688 | 1688 |
1689 #if defined(OS_ANDROID) | 1689 #if defined(OS_ANDROID) || defined(TOOLKIT_VIEWS) |
1690 // Note that |rect| is in coordinates of pixels relative to the window origin. | |
1691 // Aura-based systems will want to convert this to DIPs. | |
1690 if (view_) | 1692 if (view_) |
1691 view_->ShowDisambiguationPopup(rect, zoomed_bitmap); | 1693 view_->ShowDisambiguationPopup(rect, zoomed_bitmap); |
sky
2014/09/11 14:53:43
rect->rect_pixels and similarly rename in RenderWi
luken
2014/09/17 00:00:48
Renamed. The Android code needs pixels. I just add
| |
1692 #else | 1694 #else |
1693 NOTIMPLEMENTED(); | 1695 NOTIMPLEMENTED(); |
1694 #endif | 1696 #endif |
1695 | 1697 |
1698 // It is assumed that the disambiguation popup will make a copy of the | |
1699 // provided zoomed image, so we delete this one. | |
1696 zoomed_bitmap.setPixels(0); | 1700 zoomed_bitmap.setPixels(0); |
1697 Send(new ViewMsg_ReleaseDisambiguationPopupBitmap(GetRoutingID(), id)); | 1701 Send(new ViewMsg_ReleaseDisambiguationPopupBitmap(GetRoutingID(), id)); |
1698 } | 1702 } |
1699 | 1703 |
1700 #if defined(OS_WIN) | 1704 #if defined(OS_WIN) |
1701 void RenderWidgetHostImpl::OnWindowlessPluginDummyWindowCreated( | 1705 void RenderWidgetHostImpl::OnWindowlessPluginDummyWindowCreated( |
1702 gfx::NativeViewId dummy_activation_window) { | 1706 gfx::NativeViewId dummy_activation_window) { |
1703 HWND hwnd = reinterpret_cast<HWND>(dummy_activation_window); | 1707 HWND hwnd = reinterpret_cast<HWND>(dummy_activation_window); |
1704 | 1708 |
1705 // This may happen as a result of a race condition when the plugin is going | 1709 // This may happen as a result of a race condition when the plugin is going |
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2322 } | 2326 } |
2323 #endif | 2327 #endif |
2324 | 2328 |
2325 SkColorType RenderWidgetHostImpl::PreferredReadbackFormat() { | 2329 SkColorType RenderWidgetHostImpl::PreferredReadbackFormat() { |
2326 if (view_) | 2330 if (view_) |
2327 return view_->PreferredReadbackFormat(); | 2331 return view_->PreferredReadbackFormat(); |
2328 return kN32_SkColorType; | 2332 return kN32_SkColorType; |
2329 } | 2333 } |
2330 | 2334 |
2331 } // namespace content | 2335 } // namespace content |
OLD | NEW |