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 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 SkIntToScalar(rect.bottom()) }; | 363 SkIntToScalar(rect.bottom()) }; |
364 windowless_canvas_->clipRect(sk_rect); | 364 windowless_canvas_->clipRect(sk_rect); |
365 | 365 |
366 // Setup the background. | 366 // Setup the background. |
367 if (background_canvas_.get()) { | 367 if (background_canvas_.get()) { |
368 // When a background canvas is given, we're in transparent mode. This means | 368 // When a background canvas is given, we're in transparent mode. This means |
369 // the plugin wants to have the image of the page in the canvas it's drawing | 369 // the plugin wants to have the image of the page in the canvas it's drawing |
370 // into (which is windowless_canvas_) so it can do blending. So we copy the | 370 // into (which is windowless_canvas_) so it can do blending. So we copy the |
371 // background bitmap into the windowless_canvas_. | 371 // background bitmap into the windowless_canvas_. |
372 const SkBitmap& background_bitmap = | 372 const SkBitmap& background_bitmap = |
373 background_canvas_->getTopPlatformDevice().accessBitmap(false); | 373 background_canvas_->getTopDevice().accessBitmap(false); |
374 windowless_canvas_->drawBitmap(background_bitmap, 0, 0); | 374 windowless_canvas_->drawBitmap(background_bitmap, 0, 0); |
375 } else { | 375 } else { |
376 // In non-transparent mode, the plugin doesn't care what's underneath, so we | 376 // In non-transparent mode, the plugin doesn't care what's underneath, so we |
377 // can just give it black. | 377 // can just give it black. |
378 SkPaint black_fill_paint; | 378 SkPaint black_fill_paint; |
379 black_fill_paint.setARGB(0xFF, 0x00, 0x00, 0x00); | 379 black_fill_paint.setARGB(0xFF, 0x00, 0x00, 0x00); |
380 windowless_canvas_->drawPaint(black_fill_paint); | 380 windowless_canvas_->drawPaint(black_fill_paint); |
381 } | 381 } |
382 | 382 |
383 // Bring the windowless_canvas_ into the window coordinate system, which is | 383 // Bring the windowless_canvas_ into the window coordinate system, which is |
(...skipping 263 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 |