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