Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(209)

Side by Side Diff: webkit/glue/webplugin_impl.cc

Issue 42056: Basic windowless plugins, try 2. (Closed)
Patch Set: review comments Created 11 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webkit/glue/plugins/webplugin_delegate_impl_gtk.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "config.h" 5 #include "config.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 9
10 MSVC_PUSH_WARNING_LEVEL(0); 10 MSVC_PUSH_WARNING_LEVEL(0);
(...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after
711 711
712 DCHECK(parent()->isFrameView()); 712 DCHECK(parent()->isFrameView());
713 WebCore::FrameView* view = static_cast<WebCore::FrameView*>(parent()); 713 WebCore::FrameView* view = static_cast<WebCore::FrameView*>(parent());
714 714
715 // The plugin is positioned in window coordinates, so it needs to be painted 715 // The plugin is positioned in window coordinates, so it needs to be painted
716 // in window coordinates. 716 // in window coordinates.
717 WebCore::IntPoint origin = view->windowToContents(WebCore::IntPoint(0, 0)); 717 WebCore::IntPoint origin = view->windowToContents(WebCore::IntPoint(0, 0));
718 gc->translate(static_cast<float>(origin.x()), 718 gc->translate(static_cast<float>(origin.x()),
719 static_cast<float>(origin.y())); 719 static_cast<float>(origin.y()));
720 720
721 #if defined(OS_WIN) 721 #if defined(OS_WIN) || defined(OS_LINUX)
722 // Note that |context| is only used when in windowless mode. 722 // Note that |context| is only used when in windowless mode.
723 gfx::NativeDrawingContext context = 723 gfx::NativeDrawingContext context =
724 gc->platformContext()->canvas()->beginPlatformPaint(); 724 gc->platformContext()->canvas()->beginPlatformPaint();
725 #elif defined (OS_MACOSX) 725 #elif defined(OS_MACOSX)
726 gfx::NativeDrawingContext context = gc->platformContext(); 726 gfx::NativeDrawingContext context = gc->platformContext();
727 #else
728 // TODO(port): the equivalent of the above.
729 void* context = NULL; // Temporary, to reduce ifdefs.
730 #endif 727 #endif
731 728
732 WebCore::IntRect window_rect = 729 WebCore::IntRect window_rect =
733 WebCore::IntRect(view->contentsToWindow(damage_rect.location()), 730 WebCore::IntRect(view->contentsToWindow(damage_rect.location()),
734 damage_rect.size()); 731 damage_rect.size());
735 732
736 delegate_->Paint(context, webkit_glue::FromIntRect(window_rect)); 733 delegate_->Paint(context, webkit_glue::FromIntRect(window_rect));
737 734
738 #if defined(OS_WIN) 735 #if defined(OS_WIN) || defined(OS_LINUX)
739 gc->platformContext()->canvas()->endPlatformPaint(); 736 gc->platformContext()->canvas()->endPlatformPaint();
740 #endif 737 #endif
741 gc->restore(); 738 gc->restore();
742 } 739 }
743 740
744 void WebPluginImpl::print(WebCore::GraphicsContext* gc) { 741 void WebPluginImpl::print(WebCore::GraphicsContext* gc) {
745 if (gc->paintingDisabled()) 742 if (gc->paintingDisabled())
746 return; 743 return;
747 744
748 if (!parent()) 745 if (!parent())
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after
1429 client_index = clients_.erase(client_index); 1426 client_index = clients_.erase(client_index);
1430 if (resource_client) 1427 if (resource_client)
1431 resource_client->DidFail(); 1428 resource_client->DidFail();
1432 } 1429 }
1433 1430
1434 // This needs to be called now and not in the destructor since the 1431 // This needs to be called now and not in the destructor since the
1435 // webframe_ might not be valid anymore. 1432 // webframe_ might not be valid anymore.
1436 webframe_->set_plugin_delegate(NULL); 1433 webframe_->set_plugin_delegate(NULL);
1437 webframe_ = NULL; 1434 webframe_ = NULL;
1438 } 1435 }
OLDNEW
« no previous file with comments | « webkit/glue/plugins/webplugin_delegate_impl_gtk.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698