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/child/npapi/webplugin_delegate_impl.h" | 5 #include "content/child/npapi/webplugin_delegate_impl.h" |
6 | 6 |
7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
8 #import <QuartzCore/QuartzCore.h> | 8 #import <QuartzCore/QuartzCore.h> |
9 #include <unistd.h> | 9 #include <unistd.h> |
10 | 10 |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 case NPDrawingModelInvalidatingCoreAnimation: { | 207 case NPDrawingModelInvalidatingCoreAnimation: { |
208 // Ask the plugin for the CALayer it created for rendering content. | 208 // Ask the plugin for the CALayer it created for rendering content. |
209 // Create a surface to host it, and request a "window" handle to identify | 209 // Create a surface to host it, and request a "window" handle to identify |
210 // the surface. | 210 // the surface. |
211 CALayer* layer = nil; | 211 CALayer* layer = nil; |
212 NPError err = instance()->NPP_GetValue(NPPVpluginCoreAnimationLayer, | 212 NPError err = instance()->NPP_GetValue(NPPVpluginCoreAnimationLayer, |
213 reinterpret_cast<void*>(&layer)); | 213 reinterpret_cast<void*>(&layer)); |
214 if (!err) { | 214 if (!err) { |
215 if (drawing_model == NPDrawingModelCoreAnimation) { | 215 if (drawing_model == NPDrawingModelCoreAnimation) { |
216 // Create the timer; it will be started when we get a window handle. | 216 // Create the timer; it will be started when we get a window handle. |
217 redraw_timer_.reset(new base::RepeatingTimer<WebPluginDelegateImpl>); | 217 redraw_timer_.reset(new base::RepeatingTimer); |
218 } | 218 } |
219 layer_ = layer; | 219 layer_ = layer; |
220 | 220 |
221 gfx::GpuPreference gpu_preference = gfx::PreferDiscreteGpu; | 221 gfx::GpuPreference gpu_preference = gfx::PreferDiscreteGpu; |
222 // On dual GPU systems, force the use of the discrete GPU for | 222 // On dual GPU systems, force the use of the discrete GPU for |
223 // the CARenderer underlying our Core Animation backend for | 223 // the CARenderer underlying our Core Animation backend for |
224 // all plugins except Flash. For some reason Unity3D's output | 224 // all plugins except Flash. For some reason Unity3D's output |
225 // doesn't show up if the integrated GPU is used. Safari keeps | 225 // doesn't show up if the integrated GPU is used. Safari keeps |
226 // even Flash 11 with Stage3D on the integrated GPU, so mirror | 226 // even Flash 11 with Stage3D on the integrated GPU, so mirror |
227 // that behavior here. | 227 // that behavior here. |
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
714 window_rect_.width(), window_rect_.height())]; | 714 window_rect_.width(), window_rect_.height())]; |
715 [CATransaction commit]; | 715 [CATransaction commit]; |
716 | 716 |
717 [renderer_ setBounds:[layer_ bounds]]; | 717 [renderer_ setBounds:[layer_ bounds]]; |
718 surface_->SetSize(window_rect_.size()); | 718 surface_->SetSize(window_rect_.size()); |
719 // Kick off the drawing timer, if necessary. | 719 // Kick off the drawing timer, if necessary. |
720 PluginVisibilityChanged(); | 720 PluginVisibilityChanged(); |
721 } | 721 } |
722 | 722 |
723 } // namespace content | 723 } // namespace content |
OLD | NEW |