OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #import <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
6 #import <QuartzCore/QuartzCore.h> | 6 #import <QuartzCore/QuartzCore.h> |
7 | 7 |
8 #include "webkit/glue/plugins/webplugin_delegate_impl.h" | 8 #include "webkit/glue/plugins/webplugin_delegate_impl.h" |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
974 } | 974 } |
975 | 975 |
976 #pragma mark - | 976 #pragma mark - |
977 #pragma mark Core Animation Support | 977 #pragma mark Core Animation Support |
978 | 978 |
979 void WebPluginDelegateImpl::DrawLayerInSurface() { | 979 void WebPluginDelegateImpl::DrawLayerInSurface() { |
980 // If we haven't plumbed up the surface yet, don't try to draw. | 980 // If we haven't plumbed up the surface yet, don't try to draw. |
981 if (!windowed_handle()) | 981 if (!windowed_handle()) |
982 return; | 982 return; |
983 | 983 |
984 surface_->StartDrawing(); | |
985 | |
986 [renderer_ beginFrameAtTime:CACurrentMediaTime() timeStamp:NULL]; | 984 [renderer_ beginFrameAtTime:CACurrentMediaTime() timeStamp:NULL]; |
987 if (CGRectIsEmpty([renderer_ updateBounds])) { | 985 if (CGRectIsEmpty([renderer_ updateBounds])) { |
988 // If nothing has changed, we are done. | 986 // If nothing has changed, we are done. |
989 [renderer_ endFrame]; | 987 [renderer_ endFrame]; |
990 return; | 988 return; |
991 } | 989 } |
| 990 |
| 991 surface_->StartDrawing(); |
| 992 |
992 CGRect layerRect = [layer_ bounds]; | 993 CGRect layerRect = [layer_ bounds]; |
993 [renderer_ addUpdateRect:layerRect]; | 994 [renderer_ addUpdateRect:layerRect]; |
994 [renderer_ render]; | 995 [renderer_ render]; |
995 [renderer_ endFrame]; | 996 [renderer_ endFrame]; |
996 | 997 |
997 surface_->EndDrawing(); | 998 surface_->EndDrawing(); |
998 } | 999 } |
999 | 1000 |
1000 // Update the size of the surface to match the current size of the plug-in. | 1001 // Update the size of the surface to match the current size of the plug-in. |
1001 void WebPluginDelegateImpl::UpdateAcceleratedSurface() { | 1002 void WebPluginDelegateImpl::UpdateAcceleratedSurface() { |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1129 return; | 1130 return; |
1130 } | 1131 } |
1131 | 1132 |
1132 qd_manager_->SetFastPathEnabled(enabled); | 1133 qd_manager_->SetFastPathEnabled(enabled); |
1133 qd_port_.port = qd_manager_->port(); | 1134 qd_port_.port = qd_manager_->port(); |
1134 WindowlessSetWindow(); | 1135 WindowlessSetWindow(); |
1135 // Send a paint event so that the new buffer gets updated immediately. | 1136 // Send a paint event so that the new buffer gets updated immediately. |
1136 WindowlessPaint(buffer_context_, clip_rect_); | 1137 WindowlessPaint(buffer_context_, clip_rect_); |
1137 } | 1138 } |
1138 #endif // !NP_NO_QUICKDRAW | 1139 #endif // !NP_NO_QUICKDRAW |
OLD | NEW |