| 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 "webkit/plugins/npapi/webplugin_impl.h" | 5 #include "webkit/plugins/npapi/webplugin_impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/memory/linked_ptr.h" | 9 #include "base/memory/linked_ptr.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 775 // Deferring the call to setBackingIOSurfaceId is an attempt to | 775 // Deferring the call to setBackingIOSurfaceId is an attempt to |
| 776 // work around garbage occasionally showing up in the plugin's | 776 // work around garbage occasionally showing up in the plugin's |
| 777 // area during live resizing of Core Animation plugins. The | 777 // area during live resizing of Core Animation plugins. The |
| 778 // assumption was that by the time this was called, the plugin | 778 // assumption was that by the time this was called, the plugin |
| 779 // process would have populated the newly allocated IOSurface. It | 779 // process would have populated the newly allocated IOSurface. It |
| 780 // is not 100% clear at this point why any garbage is getting | 780 // is not 100% clear at this point why any garbage is getting |
| 781 // through. More investigation is needed. http://crbug.com/105346 | 781 // through. More investigation is needed. http://crbug.com/105346 |
| 782 if (next_io_surface_allocated_) { | 782 if (next_io_surface_allocated_) { |
| 783 if (next_io_surface_id_) { | 783 if (next_io_surface_id_) { |
| 784 if (!io_surface_layer_.get()) { | 784 if (!io_surface_layer_.get()) { |
| 785 io_surface_layer_ = cc::IOSurfaceLayer::create(); | 785 io_surface_layer_ = cc::IOSurfaceLayer::Create(); |
| 786 web_layer_.reset(new WebKit::WebLayerImpl(io_surface_layer_)); | 786 web_layer_.reset(new WebKit::WebLayerImpl(io_surface_layer_)); |
| 787 container_->setWebLayer(web_layer_.get()); | 787 container_->setWebLayer(web_layer_.get()); |
| 788 } | 788 } |
| 789 io_surface_layer_->setIOSurfaceProperties( | 789 io_surface_layer_->setIOSurfaceProperties( |
| 790 next_io_surface_id_, | 790 next_io_surface_id_, |
| 791 gfx::Size(next_io_surface_width_, next_io_surface_height_)); | 791 gfx::Size(next_io_surface_width_, next_io_surface_height_)); |
| 792 } else { | 792 } else { |
| 793 container_->setWebLayer(NULL); | 793 container_->setWebLayer(NULL); |
| 794 web_layer_.reset(); | 794 web_layer_.reset(); |
| 795 io_surface_layer_ = NULL; | 795 io_surface_layer_ = NULL; |
| 796 } | 796 } |
| 797 next_io_surface_allocated_ = false; | 797 next_io_surface_allocated_ = false; |
| 798 } else { | 798 } else { |
| 799 if (io_surface_layer_) | 799 if (io_surface_layer_) |
| 800 io_surface_layer_->setNeedsDisplay(); | 800 io_surface_layer_->SetNeedsDisplay(); |
| 801 } | 801 } |
| 802 } | 802 } |
| 803 #endif | 803 #endif |
| 804 | 804 |
| 805 void WebPluginImpl::Invalidate() { | 805 void WebPluginImpl::Invalidate() { |
| 806 if (container_) | 806 if (container_) |
| 807 container_->invalidate(); | 807 container_->invalidate(); |
| 808 } | 808 } |
| 809 | 809 |
| 810 void WebPluginImpl::InvalidateRect(const gfx::Rect& rect) { | 810 void WebPluginImpl::InvalidateRect(const gfx::Rect& rect) { |
| (...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1368 webframe_->setReferrerForRequest(*request, plugin_url_); | 1368 webframe_->setReferrerForRequest(*request, plugin_url_); |
| 1369 break; | 1369 break; |
| 1370 | 1370 |
| 1371 default: | 1371 default: |
| 1372 break; | 1372 break; |
| 1373 } | 1373 } |
| 1374 } | 1374 } |
| 1375 | 1375 |
| 1376 } // namespace npapi | 1376 } // namespace npapi |
| 1377 } // namespace webkit | 1377 } // namespace webkit |
| OLD | NEW |