OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/renderer/npapi/webplugin_delegate_proxy.h" | 5 #include "content/renderer/npapi/webplugin_delegate_proxy.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
602 void WebPluginDelegateProxy::ResetWindowlessBitmaps() { | 602 void WebPluginDelegateProxy::ResetWindowlessBitmaps() { |
603 transport_stores_[0].bitmap.reset(); | 603 transport_stores_[0].bitmap.reset(); |
604 transport_stores_[1].bitmap.reset(); | 604 transport_stores_[1].bitmap.reset(); |
605 | 605 |
606 transport_stores_[0].canvas.reset(); | 606 transport_stores_[0].canvas.reset(); |
607 transport_stores_[1].canvas.reset(); | 607 transport_stores_[1].canvas.reset(); |
608 transport_store_painted_ = gfx::Rect(); | 608 transport_store_painted_ = gfx::Rect(); |
609 front_buffer_diff_ = gfx::Rect(); | 609 front_buffer_diff_ = gfx::Rect(); |
610 } | 610 } |
611 | 611 |
| 612 #if !defined(OS_WIN) |
612 static size_t BitmapSizeForPluginRect(const gfx::Rect& plugin_rect) { | 613 static size_t BitmapSizeForPluginRect(const gfx::Rect& plugin_rect) { |
613 const size_t stride = | 614 const size_t stride = |
614 skia::PlatformCanvasStrideForWidth(plugin_rect.width()); | 615 skia::PlatformCanvasStrideForWidth(plugin_rect.width()); |
615 return stride * plugin_rect.height(); | 616 return stride * plugin_rect.height(); |
616 } | 617 } |
617 | 618 |
618 #if !defined(OS_WIN) | |
619 bool WebPluginDelegateProxy::CreateLocalBitmap( | 619 bool WebPluginDelegateProxy::CreateLocalBitmap( |
620 std::vector<uint8>* memory, | 620 std::vector<uint8>* memory, |
621 scoped_ptr<skia::PlatformCanvas>* canvas) { | 621 scoped_ptr<skia::PlatformCanvas>* canvas) { |
622 const size_t size = BitmapSizeForPluginRect(plugin_rect_); | 622 const size_t size = BitmapSizeForPluginRect(plugin_rect_); |
623 memory->resize(size); | 623 memory->resize(size); |
624 if (memory->size() != size) | 624 if (memory->size() != size) |
625 return false; | 625 return false; |
626 canvas->reset(skia::CreatePlatformCanvas( | 626 canvas->reset(skia::CreatePlatformCanvas( |
627 plugin_rect_.width(), plugin_rect_.height(), true, &((*memory)[0]), | 627 plugin_rect_.width(), plugin_rect_.height(), true, &((*memory)[0]), |
628 skia::CRASH_ON_FAILURE)); | 628 skia::CRASH_ON_FAILURE)); |
(...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1229 | 1229 |
1230 plugin_->URLRedirectResponse(allow, resource_id); | 1230 plugin_->URLRedirectResponse(allow, resource_id); |
1231 } | 1231 } |
1232 | 1232 |
1233 void WebPluginDelegateProxy::OnCheckIfRunInsecureContent(const GURL& url, | 1233 void WebPluginDelegateProxy::OnCheckIfRunInsecureContent(const GURL& url, |
1234 bool* result) { | 1234 bool* result) { |
1235 *result = plugin_->CheckIfRunInsecureContent(url); | 1235 *result = plugin_->CheckIfRunInsecureContent(url); |
1236 } | 1236 } |
1237 | 1237 |
1238 } // namespace content | 1238 } // namespace content |
OLD | NEW |