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_.Intersect(damage_rect); | 358 gfx::Rect draw_rect = window_rect_; |
| 359 draw_rect.Intersect(damage_rect); |
359 | 360 |
360 // clip_rect_ is relative to the plugin | 361 // clip_rect_ is relative to the plugin |
361 gfx::Rect clip_rect_window = clip_rect_; | 362 gfx::Rect clip_rect_window = clip_rect_; |
362 clip_rect_window.Offset(window_rect_.x(), window_rect_.y()); | 363 clip_rect_window.Offset(window_rect_.x(), window_rect_.y()); |
363 draw_rect = draw_rect.Intersect(clip_rect_window); | 364 draw_rect.Intersect(clip_rect_window); |
364 | 365 |
365 // These offsets represent by how much the view is shifted to accomodate | 366 // These offsets represent by how much the view is shifted to accomodate |
366 // Flash (the coordinates of X relative to O in the diagram above). | 367 // Flash (the coordinates of X relative to O in the diagram above). |
367 int offset_x = 0; | 368 int offset_x = 0; |
368 int offset_y = 0; | 369 int offset_y = 0; |
369 if (quirks_ & PLUGIN_QUIRK_WINDOWLESS_OFFSET_WINDOW_TO_DRAW) { | 370 if (quirks_ & PLUGIN_QUIRK_WINDOWLESS_OFFSET_WINDOW_TO_DRAW) { |
370 offset_x = -draw_rect.x(); | 371 offset_x = -draw_rect.x(); |
371 offset_y = -draw_rect.y(); | 372 offset_y = -draw_rect.y(); |
372 window_.clipRect.top = 0; | 373 window_.clipRect.top = 0; |
373 window_.clipRect.left = 0; | 374 window_.clipRect.left = 0; |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
746 // as someone might be setting the cursor in the main process as well. | 747 // as someone might be setting the cursor in the main process as well. |
747 *cursor = current_windowless_cursor_; | 748 *cursor = current_windowless_cursor_; |
748 } | 749 } |
749 #endif | 750 #endif |
750 | 751 |
751 return ret; | 752 return ret; |
752 } | 753 } |
753 | 754 |
754 } // namespace npapi | 755 } // namespace npapi |
755 } // namespace webkit | 756 } // namespace webkit |
OLD | NEW |