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 1717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1728 GetProcess()->ReceivedBadMessage(); | 1728 GetProcess()->ReceivedBadMessage(); |
1729 return; | 1729 return; |
1730 } | 1730 } |
1731 | 1731 |
1732 DCHECK(bitmap->pixels()); | 1732 DCHECK(bitmap->pixels()); |
1733 | 1733 |
1734 SkImageInfo info = SkImageInfo::MakeN32Premul(size.width(), size.height()); | 1734 SkImageInfo info = SkImageInfo::MakeN32Premul(size.width(), size.height()); |
1735 SkBitmap zoomed_bitmap; | 1735 SkBitmap zoomed_bitmap; |
1736 zoomed_bitmap.installPixels(info, bitmap->pixels(), info.minRowBytes()); | 1736 zoomed_bitmap.installPixels(info, bitmap->pixels(), info.minRowBytes()); |
1737 | 1737 |
1738 #if defined(OS_ANDROID) || defined(TOOLKIT_VIEWS) | |
1739 // Note that |rect| is in coordinates of pixels relative to the window origin. | 1738 // Note that |rect| is in coordinates of pixels relative to the window origin. |
1740 // Aura-based systems will want to convert this to DIPs. | 1739 // Aura-based systems will want to convert this to DIPs. |
1741 if (view_) | 1740 if (view_) |
1742 view_->ShowDisambiguationPopup(rect_pixels, zoomed_bitmap); | 1741 view_->ShowDisambiguationPopup(rect_pixels, zoomed_bitmap); |
1743 #else | |
1744 NOTIMPLEMENTED(); | |
1745 #endif | |
1746 | 1742 |
1747 // It is assumed that the disambiguation popup will make a copy of the | 1743 // It is assumed that the disambiguation popup will make a copy of the |
1748 // provided zoomed image, so we delete this one. | 1744 // provided zoomed image, so we delete this one. |
1749 zoomed_bitmap.setPixels(0); | 1745 zoomed_bitmap.setPixels(0); |
1750 Send(new ViewMsg_ReleaseDisambiguationPopupBitmap(GetRoutingID(), id)); | 1746 Send(new ViewMsg_ReleaseDisambiguationPopupBitmap(GetRoutingID(), id)); |
1751 } | 1747 } |
1752 | 1748 |
1753 #if defined(OS_WIN) | 1749 #if defined(OS_WIN) |
1754 void RenderWidgetHostImpl::OnWindowlessPluginDummyWindowCreated( | 1750 void RenderWidgetHostImpl::OnWindowlessPluginDummyWindowCreated( |
1755 gfx::NativeViewId dummy_activation_window) { | 1751 gfx::NativeViewId dummy_activation_window) { |
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2375 } | 2371 } |
2376 #endif | 2372 #endif |
2377 | 2373 |
2378 SkColorType RenderWidgetHostImpl::PreferredReadbackFormat() { | 2374 SkColorType RenderWidgetHostImpl::PreferredReadbackFormat() { |
2379 if (view_) | 2375 if (view_) |
2380 return view_->PreferredReadbackFormat(); | 2376 return view_->PreferredReadbackFormat(); |
2381 return kN32_SkColorType; | 2377 return kN32_SkColorType; |
2382 } | 2378 } |
2383 | 2379 |
2384 } // namespace content | 2380 } // namespace content |
OLD | NEW |