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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_gtk.cc

Issue 11269022: Add Vector2d classes that represent offsets, instead of using Point. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more vector use fixes Created 8 years, 1 month 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 | Annotate | Revision Log
OLDNEW
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_view_gtk.h" 5 #include "content/browser/renderer_host/render_widget_host_view_gtk.h"
6 6
7 // If this gets included after the gtk headers, then a bunch of compiler 7 // If this gets included after the gtk headers, then a bunch of compiler
8 // errors happen because of a "#define Status int" in Xlib.h, which interacts 8 // errors happen because of a "#define Status int" in Xlib.h, which interacts
9 // badly with net::URLRequestStatus::Status. 9 // badly with net::URLRequestStatus::Status.
10 #include "content/common/view_messages.h" 10 #include "content/common/view_messages.h"
(...skipping 740 matching lines...) Expand 10 before | Expand all | Expand 10 after
751 gfx::NativeViewId RenderWidgetHostViewGtk::GetNativeViewId() const { 751 gfx::NativeViewId RenderWidgetHostViewGtk::GetNativeViewId() const {
752 return GtkNativeViewManager::GetInstance()->GetIdForWidget(view_.get()); 752 return GtkNativeViewManager::GetInstance()->GetIdForWidget(view_.get());
753 } 753 }
754 754
755 gfx::NativeViewAccessible RenderWidgetHostViewGtk::GetNativeViewAccessible() { 755 gfx::NativeViewAccessible RenderWidgetHostViewGtk::GetNativeViewAccessible() {
756 NOTIMPLEMENTED(); 756 NOTIMPLEMENTED();
757 return NULL; 757 return NULL;
758 } 758 }
759 759
760 void RenderWidgetHostViewGtk::MovePluginWindows( 760 void RenderWidgetHostViewGtk::MovePluginWindows(
761 const gfx::Point& scroll_offset, 761 const gfx::Vector2d& scroll_offset,
762 const std::vector<webkit::npapi::WebPluginGeometry>& moves) { 762 const std::vector<webkit::npapi::WebPluginGeometry>& moves) {
763 for (size_t i = 0; i < moves.size(); ++i) { 763 for (size_t i = 0; i < moves.size(); ++i) {
764 plugin_container_manager_.MovePluginContainer(moves[i]); 764 plugin_container_manager_.MovePluginContainer(moves[i]);
765 } 765 }
766 } 766 }
767 767
768 void RenderWidgetHostViewGtk::Focus() { 768 void RenderWidgetHostViewGtk::Focus() {
769 gtk_widget_grab_focus(view_.get()); 769 gtk_widget_grab_focus(view_.get());
770 } 770 }
771 771
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
1037 1037
1038 // NOTE: |output| is initialized with the size of |src_subrect|, and |dst_size| 1038 // NOTE: |output| is initialized with the size of |src_subrect|, and |dst_size|
1039 // is ignored on GTK. 1039 // is ignored on GTK.
1040 void RenderWidgetHostViewGtk::CopyFromCompositingSurface( 1040 void RenderWidgetHostViewGtk::CopyFromCompositingSurface(
1041 const gfx::Rect& src_subrect, 1041 const gfx::Rect& src_subrect,
1042 const gfx::Size& /* dst_size */, 1042 const gfx::Size& /* dst_size */,
1043 const base::Callback<void(bool)>& callback, 1043 const base::Callback<void(bool)>& callback,
1044 skia::PlatformBitmap* output) { 1044 skia::PlatformBitmap* output) {
1045 base::ScopedClosureRunner scoped_callback_runner(base::Bind(callback, false)); 1045 base::ScopedClosureRunner scoped_callback_runner(base::Bind(callback, false));
1046 1046
1047 const gfx::Rect bounds = GetViewBounds(); 1047 gfx::Rect src_subrect_in_view = src_subrect;
1048 src_subrect_in_view.Offset(GetViewBounds().OffsetFromOrigin());
1049
1048 ui::XScopedImage image(XGetImage(ui::GetXDisplay(), ui::GetX11RootWindow(), 1050 ui::XScopedImage image(XGetImage(ui::GetXDisplay(), ui::GetX11RootWindow(),
1049 bounds.x() + src_subrect.x(), 1051 src_subrect_in_view.x(),
1050 bounds.y() + src_subrect.y(), 1052 src_subrect_in_view.y(),
1051 src_subrect.width(), 1053 src_subrect_in_view.width(),
1052 src_subrect.height(), 1054 src_subrect_in_view.height(),
1053 AllPlanes, ZPixmap)); 1055 AllPlanes, ZPixmap));
1054 if (!image.get()) 1056 if (!image.get())
1055 return; 1057 return;
1056 1058
1057 if (!output->Allocate(src_subrect.width(), src_subrect.height(), true)) 1059 if (!output->Allocate(src_subrect.width(), src_subrect.height(), true))
1058 return; 1060 return;
1059 1061
1060 const SkBitmap& bitmap = output->GetBitmap(); 1062 const SkBitmap& bitmap = output->GetBitmap();
1061 const size_t bitmap_size = bitmap.getSize(); 1063 const size_t bitmap_size = bitmap.getSize();
1062 DCHECK_EQ(bitmap_size, 1064 DCHECK_EQ(bitmap_size,
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after
1550 this)); 1552 this));
1551 } 1553 }
1552 BrowserAccessibilityGtk* root = 1554 BrowserAccessibilityGtk* root =
1553 browser_accessibility_manager_->GetRoot()->ToBrowserAccessibilityGtk(); 1555 browser_accessibility_manager_->GetRoot()->ToBrowserAccessibilityGtk();
1554 1556
1555 atk_object_set_role(root->GetAtkObject(), ATK_ROLE_HTML_CONTAINER); 1557 atk_object_set_role(root->GetAtkObject(), ATK_ROLE_HTML_CONTAINER);
1556 return root->GetAtkObject(); 1558 return root->GetAtkObject();
1557 } 1559 }
1558 1560
1559 } // namespace content 1561 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698