Chromium Code Reviews| 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/browser/renderer_host/render_widget_host_view_mac.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_mac.h" |
| 6 | 6 |
| 7 #include <QuartzCore/QuartzCore.h> | 7 #include <QuartzCore/QuartzCore.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 1219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1230 base::StringPrintf("window %s delegate %s controller %s", | 1230 base::StringPrintf("window %s delegate %s controller %s", |
| 1231 object_getClassName(window), | 1231 object_getClassName(window), |
| 1232 object_getClassName([window delegate]), | 1232 object_getClassName([window delegate]), |
| 1233 object_getClassName([window windowController])); | 1233 object_getClassName([window windowController])); |
| 1234 base::debug::SetCrashKeyValue(kCrashKey, value); | 1234 base::debug::SetCrashKeyValue(kCrashKey, value); |
| 1235 } | 1235 } |
| 1236 | 1236 |
| 1237 return true; | 1237 return true; |
| 1238 } | 1238 } |
| 1239 | 1239 |
| 1240 bool should_post_notification = false; | 1240 bool should_post_notification = false; |
|
Robert Sesek
2013/06/27 18:45:38
This variable is unused.
sail
2013/06/27 18:47:59
Done.
| |
| 1241 | 1241 |
| 1242 if (use_core_animation_) { | 1242 if (use_core_animation_) { |
| 1243 if (!CreateCompositedIOSurfaceAndLayer()) { | 1243 if (!CreateCompositedIOSurfaceAndLayer()) { |
| 1244 LOG(ERROR) << "Failed to create CompositingIOSurface or its layer"; | 1244 LOG(ERROR) << "Failed to create CompositingIOSurface or its layer"; |
| 1245 return false; | 1245 return false; |
| 1246 } | 1246 } |
| 1247 } else { | 1247 } else { |
| 1248 if (!compositing_iosurface_) { | 1248 if (!compositing_iosurface_) { |
| 1249 compositing_iosurface_.reset( | 1249 compositing_iosurface_.reset( |
| 1250 CompositingIOSurfaceMac::Create(window_number())); | 1250 CompositingIOSurfaceMac::Create(window_number())); |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 1279 [compositing_iosurface_layer_ setNeedsDisplay]; | 1279 [compositing_iosurface_layer_ setNeedsDisplay]; |
| 1280 } else { | 1280 } else { |
| 1281 if (!compositing_iosurface_->DrawIOSurface(this)) { | 1281 if (!compositing_iosurface_->DrawIOSurface(this)) { |
| 1282 [cocoa_view_ setNeedsDisplay:YES]; | 1282 [cocoa_view_ setNeedsDisplay:YES]; |
| 1283 GotAcceleratedCompositingError(); | 1283 GotAcceleratedCompositingError(); |
| 1284 return false; | 1284 return false; |
| 1285 } | 1285 } |
| 1286 } | 1286 } |
| 1287 } | 1287 } |
| 1288 | 1288 |
| 1289 if (should_post_notification && [[cocoa_view_ delegate] | |
| 1290 respondsToSelector:@selector(compositingIOSurfaceCreated)]) { | |
| 1291 [[cocoa_view_ delegate] compositingIOSurfaceCreated]; | |
| 1292 } | |
| 1293 | |
| 1294 return true; | 1289 return true; |
| 1295 } | 1290 } |
| 1296 | 1291 |
| 1297 void RenderWidgetHostViewMac::AckPendingSwapBuffers() { | 1292 void RenderWidgetHostViewMac::AckPendingSwapBuffers() { |
| 1298 TRACE_EVENT0("browser", "RenderWidgetHostViewMac::AckPendingSwapBuffers"); | 1293 TRACE_EVENT0("browser", "RenderWidgetHostViewMac::AckPendingSwapBuffers"); |
| 1299 | 1294 |
| 1300 // Cancel any outstanding delayed calls to this function. | 1295 // Cancel any outstanding delayed calls to this function. |
| 1301 pending_swap_buffers_acks_weak_factory_.InvalidateWeakPtrs(); | 1296 pending_swap_buffers_acks_weak_factory_.InvalidateWeakPtrs(); |
| 1302 | 1297 |
| 1303 while (!pending_swap_buffers_acks_.empty()) { | 1298 while (!pending_swap_buffers_acks_.empty()) { |
| (...skipping 2419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3723 return YES; | 3718 return YES; |
| 3724 } | 3719 } |
| 3725 | 3720 |
| 3726 - (BOOL)isOpaque { | 3721 - (BOOL)isOpaque { |
| 3727 if (renderWidgetHostView_->use_core_animation_) | 3722 if (renderWidgetHostView_->use_core_animation_) |
| 3728 return YES; | 3723 return YES; |
| 3729 return [super isOpaque]; | 3724 return [super isOpaque]; |
| 3730 } | 3725 } |
| 3731 | 3726 |
| 3732 @end | 3727 @end |
| OLD | NEW |