OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/memory/scoped_handle.h" | 10 #include "base/memory/scoped_handle.h" |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
343 CGRect source_rect = rect.ToCGRect(); | 343 CGRect source_rect = rect.ToCGRect(); |
344 // Flip the rect we use to pull from the canvas, since it's upside-down. | 344 // Flip the rect we use to pull from the canvas, since it's upside-down. |
345 source_rect.origin.y = CGImageGetHeight(image) - rect.y() - rect.height(); | 345 source_rect.origin.y = CGImageGetHeight(image) - rect.y() - rect.height(); |
346 base::mac::ScopedCFTypeRef<CGImageRef> sub_image( | 346 base::mac::ScopedCFTypeRef<CGImageRef> sub_image( |
347 CGImageCreateWithImageInRect(image, source_rect)); | 347 CGImageCreateWithImageInRect(image, source_rect)); |
348 CGContextDrawImage(windowless_context_, rect.ToCGRect(), sub_image); | 348 CGContextDrawImage(windowless_context_, rect.ToCGRect(), sub_image); |
349 } else if (transparent_) { | 349 } else if (transparent_) { |
350 CGContextClearRect(windowless_context_, rect.ToCGRect()); | 350 CGContextClearRect(windowless_context_, rect.ToCGRect()); |
351 } | 351 } |
352 CGContextClipToRect(windowless_context_, rect.ToCGRect()); | 352 CGContextClipToRect(windowless_context_, rect.ToCGRect()); |
353 delegate_->Paint(windowless_context_, rect); | 353 delegate_->CGPaint(windowless_context_, rect); |
stuartmorgan
2011/04/12 21:15:37
This is another case where this whole codepath exi
_cary
2011/04/13 11:58:18
Done.
| |
354 if (windowless_context_.get() == saved_context_weak) | 354 if (windowless_context_.get() == saved_context_weak) |
355 CGContextRestoreGState(windowless_context_); | 355 CGContextRestoreGState(windowless_context_); |
356 #else | 356 #else |
357 windowless_canvas_->save(); | 357 windowless_canvas_->save(); |
358 | 358 |
359 // The given clip rect is relative to the plugin coordinate system. | 359 // The given clip rect is relative to the plugin coordinate system. |
360 SkRect sk_rect = { SkIntToScalar(rect.x()), | 360 SkRect sk_rect = { SkIntToScalar(rect.x()), |
361 SkIntToScalar(rect.y()), | 361 SkIntToScalar(rect.y()), |
362 SkIntToScalar(rect.right()), | 362 SkIntToScalar(rect.right()), |
363 SkIntToScalar(rect.bottom()) }; | 363 SkIntToScalar(rect.bottom()) }; |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
647 resource_clients_.erase(index++); | 647 resource_clients_.erase(index++); |
648 } else { | 648 } else { |
649 index++; | 649 index++; |
650 } | 650 } |
651 } | 651 } |
652 } | 652 } |
653 | 653 |
654 void WebPluginProxy::URLRedirectResponse(bool allow, int resource_id) { | 654 void WebPluginProxy::URLRedirectResponse(bool allow, int resource_id) { |
655 Send(new PluginHostMsg_URLRedirectResponse(route_id_, allow, resource_id)); | 655 Send(new PluginHostMsg_URLRedirectResponse(route_id_, allow, resource_id)); |
656 } | 656 } |
OLD | NEW |