OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "chrome/plugin/webplugin_proxy.h" | 5 #include "chrome/plugin/webplugin_proxy.h" |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 | 8 |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/scoped_handle.h" | 10 #include "base/scoped_handle.h" |
11 #include "base/shared_memory.h" | 11 #include "base/shared_memory.h" |
12 #include "build/build_config.h" | 12 #include "build/build_config.h" |
13 #include "chrome/common/child_process_logging.h" | 13 #include "chrome/common/child_process_logging.h" |
14 #include "chrome/common/plugin_messages.h" | 14 #include "chrome/common/plugin_messages.h" |
15 #include "chrome/common/url_constants.h" | 15 #include "chrome/common/url_constants.h" |
16 #include "chrome/plugin/npobject_proxy.h" | 16 #include "chrome/plugin/npobject_proxy.h" |
17 #include "chrome/plugin/npobject_util.h" | 17 #include "chrome/plugin/npobject_util.h" |
18 #include "chrome/plugin/plugin_channel.h" | 18 #include "chrome/plugin/plugin_channel.h" |
19 #include "chrome/plugin/plugin_thread.h" | 19 #include "chrome/plugin/plugin_thread.h" |
20 #include "gfx/blit.h" | 20 #include "gfx/blit.h" |
21 #include "gfx/canvas.h" | 21 #include "gfx/canvas.h" |
22 #include "skia/ext/platform_device.h" | 22 #include "skia/ext/platform_device.h" |
23 #include "third_party/WebKit/WebKit/chromium/public/WebBindings.h" | 23 #include "third_party/WebKit/WebKit/chromium/public/WebBindings.h" |
24 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" | 24 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" |
25 | 25 |
26 #if defined(OS_MACOSX) | 26 #if defined(OS_MACOSX) |
27 #include "base/mac_util.h" | 27 #include "base/mac/mac_util.h" |
28 #include "base/mac/scoped_cftyperef.h" | 28 #include "base/mac/scoped_cftyperef.h" |
29 #include "chrome/plugin/webplugin_accelerated_surface_proxy_mac.h" | 29 #include "chrome/plugin/webplugin_accelerated_surface_proxy_mac.h" |
30 #endif | 30 #endif |
31 | 31 |
32 #if defined(OS_WIN) | 32 #if defined(OS_WIN) |
33 #include "app/win/win_util.h" | 33 #include "app/win/win_util.h" |
34 #include "gfx/gdi_util.h" | 34 #include "gfx/gdi_util.h" |
35 #endif | 35 #endif |
36 | 36 |
37 #if defined(USE_X11) | 37 #if defined(USE_X11) |
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
566 const gfx::Rect& window_rect) { | 566 const gfx::Rect& window_rect) { |
567 // Convert the shared memory handle to a handle that works in our process, | 567 // Convert the shared memory handle to a handle that works in our process, |
568 // and then use that to create a CGContextRef. | 568 // and then use that to create a CGContextRef. |
569 windowless_dib_.reset(TransportDIB::Map(windowless_buffer)); | 569 windowless_dib_.reset(TransportDIB::Map(windowless_buffer)); |
570 background_dib_.reset(TransportDIB::Map(background_buffer)); | 570 background_dib_.reset(TransportDIB::Map(background_buffer)); |
571 windowless_context_.reset(CGBitmapContextCreate( | 571 windowless_context_.reset(CGBitmapContextCreate( |
572 windowless_dib_->memory(), | 572 windowless_dib_->memory(), |
573 window_rect.width(), | 573 window_rect.width(), |
574 window_rect.height(), | 574 window_rect.height(), |
575 8, 4 * window_rect.width(), | 575 8, 4 * window_rect.width(), |
576 mac_util::GetSystemColorSpace(), | 576 base::mac::GetSystemColorSpace(), |
577 kCGImageAlphaPremultipliedFirst | | 577 kCGImageAlphaPremultipliedFirst | |
578 kCGBitmapByteOrder32Host)); | 578 kCGBitmapByteOrder32Host)); |
579 CGContextTranslateCTM(windowless_context_, 0, window_rect.height()); | 579 CGContextTranslateCTM(windowless_context_, 0, window_rect.height()); |
580 CGContextScaleCTM(windowless_context_, 1, -1); | 580 CGContextScaleCTM(windowless_context_, 1, -1); |
581 if (background_dib_.get()) { | 581 if (background_dib_.get()) { |
582 background_context_.reset(CGBitmapContextCreate( | 582 background_context_.reset(CGBitmapContextCreate( |
583 background_dib_->memory(), | 583 background_dib_->memory(), |
584 window_rect.width(), | 584 window_rect.width(), |
585 window_rect.height(), | 585 window_rect.height(), |
586 8, 4 * window_rect.width(), | 586 8, 4 * window_rect.width(), |
587 mac_util::GetSystemColorSpace(), | 587 base::mac::GetSystemColorSpace(), |
588 kCGImageAlphaPremultipliedFirst | | 588 kCGImageAlphaPremultipliedFirst | |
589 kCGBitmapByteOrder32Host)); | 589 kCGBitmapByteOrder32Host)); |
590 CGContextTranslateCTM(background_context_, 0, window_rect.height()); | 590 CGContextTranslateCTM(background_context_, 0, window_rect.height()); |
591 CGContextScaleCTM(background_context_, 1, -1); | 591 CGContextScaleCTM(background_context_, 1, -1); |
592 } | 592 } |
593 } | 593 } |
594 | 594 |
595 #elif defined(USE_X11) | 595 #elif defined(USE_X11) |
596 | 596 |
597 void WebPluginProxy::SetWindowlessBuffer( | 597 void WebPluginProxy::SetWindowlessBuffer( |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
727 } else { | 727 } else { |
728 index++; | 728 index++; |
729 } | 729 } |
730 } | 730 } |
731 } | 731 } |
732 | 732 |
733 void WebPluginProxy::URLRedirectResponse(bool allow, int resource_id) { | 733 void WebPluginProxy::URLRedirectResponse(bool allow, int resource_id) { |
734 Send(new PluginHostMsg_URLRedirectResponse(route_id_, allow, resource_id)); | 734 Send(new PluginHostMsg_URLRedirectResponse(route_id_, allow, resource_id)); |
735 } | 735 } |
736 | 736 |
OLD | NEW |