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 "content/plugin/webplugin_proxy.h" | 5 #include "content/plugin/webplugin_proxy.h" |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 if (!windowless_context()) | 342 if (!windowless_context()) |
343 return; | 343 return; |
344 #else | 344 #else |
345 if (!windowless_canvas() || !windowless_canvas()->getDevice()) | 345 if (!windowless_canvas() || !windowless_canvas()->getDevice()) |
346 return; | 346 return; |
347 #endif | 347 #endif |
348 | 348 |
349 // Clear the damaged area so that if the plugin doesn't paint there we won't | 349 // Clear the damaged area so that if the plugin doesn't paint there we won't |
350 // end up with the old values. | 350 // end up with the old values. |
351 gfx::Rect offset_rect = rect; | 351 gfx::Rect offset_rect = rect; |
352 offset_rect.Offset(delegate_->GetRect().origin()); | 352 offset_rect.Offset(delegate_->GetRect().OffsetFromOrigin()); |
353 #if defined(OS_MACOSX) | 353 #if defined(OS_MACOSX) |
354 CGContextSaveGState(windowless_context()); | 354 CGContextSaveGState(windowless_context()); |
355 // It is possible for windowless_contexts_ to change during plugin painting | 355 // It is possible for windowless_contexts_ to change during plugin painting |
356 // (since the plugin can make a synchronous call during paint event handling), | 356 // (since the plugin can make a synchronous call during paint event handling), |
357 // in which case we don't want to try to restore later. Not an owning ref | 357 // in which case we don't want to try to restore later. Not an owning ref |
358 // since owning the ref without owning the shared backing memory doesn't make | 358 // since owning the ref without owning the shared backing memory doesn't make |
359 // sense, so this should only be used for pointer comparisons. | 359 // sense, so this should only be used for pointer comparisons. |
360 CGContextRef saved_context_weak = windowless_context(); | 360 CGContextRef saved_context_weak = windowless_context(); |
361 // We also save the buffer index for the comparison because if we flip buffers | 361 // We also save the buffer index for the comparison because if we flip buffers |
362 // but haven't reallocated them then we do need to restore the context because | 362 // but haven't reallocated them then we do need to restore the context because |
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
783 int input_type; | 783 int input_type; |
784 gfx::Rect caret_rect; | 784 gfx::Rect caret_rect; |
785 if (!delegate_->GetIMEStatus(&input_type, &caret_rect)) | 785 if (!delegate_->GetIMEStatus(&input_type, &caret_rect)) |
786 return; | 786 return; |
787 | 787 |
788 Send(new PluginHostMsg_NotifyIMEStatus(route_id_, input_type, caret_rect)); | 788 Send(new PluginHostMsg_NotifyIMEStatus(route_id_, input_type, caret_rect)); |
789 } | 789 } |
790 #endif | 790 #endif |
791 | 791 |
792 } // namespace content | 792 } // namespace content |
OLD | NEW |