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

Side by Side Diff: webkit/plugins/npapi/webplugin_delegate_impl_gtk.cc

Issue 11270042: Add non-member non-mutating methods for common gfx::Rect operations. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased 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
« no previous file with comments | « ui/views/widget/root_view.cc ('k') | webkit/plugins/ppapi/ppapi_plugin_instance.cc » ('j') | 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) 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 "webkit/plugins/npapi/webplugin_delegate_impl.h" 5 #include "webkit/plugins/npapi/webplugin_delegate_impl.h"
6 6
7 #include <gtk/gtk.h> 7 #include <gtk/gtk.h>
8 #include <gdk/gdkx.h> 8 #include <gdk/gdkx.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 // | | H plugin | H 348 // | | H plugin | H
349 // | +-------#------------------------------+ H 349 // | +-------#------------------------------+ H
350 // | H H 350 // | H H
351 // | H "apparent" window H 351 // | H "apparent" window H
352 // +---------------#=================================================# 352 // +---------------#=================================================#
353 // X = "real" origin 353 // X = "real" origin
354 // O = "apparent" origin 354 // O = "apparent" origin
355 // "real" means as seen by Chrome 355 // "real" means as seen by Chrome
356 // "apparent" means as seen by the plugin. 356 // "apparent" means as seen by the plugin.
357 357
358 gfx::Rect draw_rect = window_rect_; 358 gfx::Rect draw_rect = gfx::IntersectRects(window_rect_, damage_rect);
359 draw_rect.Intersect(damage_rect);
360 359
361 // clip_rect_ is relative to the plugin 360 // clip_rect_ is relative to the plugin
362 gfx::Rect clip_rect_window = clip_rect_; 361 gfx::Rect clip_rect_window = clip_rect_;
363 clip_rect_window.Offset(window_rect_.x(), window_rect_.y()); 362 clip_rect_window.Offset(window_rect_.x(), window_rect_.y());
364 draw_rect.Intersect(clip_rect_window); 363 draw_rect.Intersect(clip_rect_window);
365 364
366 // These offsets represent by how much the view is shifted to accomodate 365 // These offsets represent by how much the view is shifted to accomodate
367 // Flash (the coordinates of X relative to O in the diagram above). 366 // Flash (the coordinates of X relative to O in the diagram above).
368 int offset_x = 0; 367 int offset_x = 0;
369 int offset_y = 0; 368 int offset_y = 0;
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
747 // as someone might be setting the cursor in the main process as well. 746 // as someone might be setting the cursor in the main process as well.
748 *cursor = current_windowless_cursor_; 747 *cursor = current_windowless_cursor_;
749 } 748 }
750 #endif 749 #endif
751 750
752 return ret; 751 return ret;
753 } 752 }
754 753
755 } // namespace npapi 754 } // namespace npapi
756 } // namespace webkit 755 } // namespace webkit
OLDNEW
« no previous file with comments | « ui/views/widget/root_view.cc ('k') | webkit/plugins/ppapi/ppapi_plugin_instance.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698