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 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 SkIntToScalar(rect.bottom()) }; | 364 SkIntToScalar(rect.bottom()) }; |
365 windowless_canvas_->clipRect(sk_rect); | 365 windowless_canvas_->clipRect(sk_rect); |
366 | 366 |
367 // Setup the background. | 367 // Setup the background. |
368 if (background_canvas_.get()) { | 368 if (background_canvas_.get()) { |
369 // When a background canvas is given, we're in transparent mode. This means | 369 // When a background canvas is given, we're in transparent mode. This means |
370 // the plugin wants to have the image of the page in the canvas it's drawing | 370 // the plugin wants to have the image of the page in the canvas it's drawing |
371 // into (which is windowless_canvas_) so it can do blending. So we copy the | 371 // into (which is windowless_canvas_) so it can do blending. So we copy the |
372 // background bitmap into the windowless_canvas_. | 372 // background bitmap into the windowless_canvas_. |
373 const SkBitmap& background_bitmap = | 373 const SkBitmap& background_bitmap = |
374 background_canvas_->getTopPlatformDevice().accessBitmap(false); | 374 skia::GetTopDevice(background_canvas_.get())->accessBitmap(false); |
375 windowless_canvas_->drawBitmap(background_bitmap, 0, 0); | 375 windowless_canvas_->drawBitmap(background_bitmap, 0, 0); |
376 } else { | 376 } else { |
377 // In non-transparent mode, the plugin doesn't care what's underneath, so we | 377 // In non-transparent mode, the plugin doesn't care what's underneath, so we |
378 // can just give it black. | 378 // can just give it black. |
379 SkPaint black_fill_paint; | 379 SkPaint black_fill_paint; |
380 black_fill_paint.setARGB(0xFF, 0x00, 0x00, 0x00); | 380 black_fill_paint.setARGB(0xFF, 0x00, 0x00, 0x00); |
381 windowless_canvas_->drawPaint(black_fill_paint); | 381 windowless_canvas_->drawPaint(black_fill_paint); |
382 } | 382 } |
383 | 383 |
384 // Bring the windowless_canvas_ into the window coordinate system, which is | 384 // Bring the windowless_canvas_ into the window coordinate system, which is |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
648 resource_clients_.erase(index++); | 648 resource_clients_.erase(index++); |
649 } else { | 649 } else { |
650 index++; | 650 index++; |
651 } | 651 } |
652 } | 652 } |
653 } | 653 } |
654 | 654 |
655 void WebPluginProxy::URLRedirectResponse(bool allow, int resource_id) { | 655 void WebPluginProxy::URLRedirectResponse(bool allow, int resource_id) { |
656 Send(new PluginHostMsg_URLRedirectResponse(route_id_, allow, resource_id)); | 656 Send(new PluginHostMsg_URLRedirectResponse(route_id_, allow, resource_id)); |
657 } | 657 } |
OLD | NEW |