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

Side by Side Diff: content/plugin/webplugin_proxy.cc

Issue 6823081: Add Skia to CG adapter for plugins. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 9 years, 7 months 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
OLDNEW
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
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 // FIXME: This is a temporary workaround to allow the Darwin / Skia port to
brettw 2011/05/18 20:15:46 This should be: TODO(caryclark): This is a...
_cary 2011/05/19 12:28:38 Done.
354 // share code with the Darwin / CG port. All ports will eventually use the
355 // common code below.
356 delegate_->CGPaint(windowless_context_, rect);
354 if (windowless_context_.get() == saved_context_weak) 357 if (windowless_context_.get() == saved_context_weak)
355 CGContextRestoreGState(windowless_context_); 358 CGContextRestoreGState(windowless_context_);
356 #else 359 #else
357 windowless_canvas_->save(); 360 windowless_canvas_->save();
358 361
359 // The given clip rect is relative to the plugin coordinate system. 362 // The given clip rect is relative to the plugin coordinate system.
360 SkRect sk_rect = { SkIntToScalar(rect.x()), 363 SkRect sk_rect = { SkIntToScalar(rect.x()),
361 SkIntToScalar(rect.y()), 364 SkIntToScalar(rect.y()),
362 SkIntToScalar(rect.right()), 365 SkIntToScalar(rect.right()),
363 SkIntToScalar(rect.bottom()) }; 366 SkIntToScalar(rect.bottom()) };
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
647 resource_clients_.erase(index++); 650 resource_clients_.erase(index++);
648 } else { 651 } else {
649 index++; 652 index++;
650 } 653 }
651 } 654 }
652 } 655 }
653 656
654 void WebPluginProxy::URLRedirectResponse(bool allow, int resource_id) { 657 void WebPluginProxy::URLRedirectResponse(bool allow, int resource_id) {
655 Send(new PluginHostMsg_URLRedirectResponse(route_id_, allow, resource_id)); 658 Send(new PluginHostMsg_URLRedirectResponse(route_id_, allow, resource_id));
656 } 659 }
OLDNEW
« no previous file with comments | « no previous file | webkit/plugins/npapi/webplugin_delegate_impl.h » ('j') | webkit/plugins/npapi/webplugin_delegate_impl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698