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 "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 Loading... |
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 Loading... |
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 |
OLD | NEW |