| 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 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ |
| 7 | 7 |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 #include <list> | 9 #include <list> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 // Updates the current plugin focus state. | 179 // Updates the current plugin focus state. |
| 180 - (void)pluginFocusChanged:(BOOL)focused forPlugin:(int)pluginId; | 180 - (void)pluginFocusChanged:(BOOL)focused forPlugin:(int)pluginId; |
| 181 // Evaluates the event in the context of plugin IME, if plugin IME is enabled. | 181 // Evaluates the event in the context of plugin IME, if plugin IME is enabled. |
| 182 // Returns YES if the event was handled. | 182 // Returns YES if the event was handled. |
| 183 - (BOOL)postProcessEventForPluginIme:(NSEvent*)event; | 183 - (BOOL)postProcessEventForPluginIme:(NSEvent*)event; |
| 184 - (void)updateCursor:(NSCursor*)cursor; | 184 - (void)updateCursor:(NSCursor*)cursor; |
| 185 - (NSRect)firstViewRectForCharacterRange:(NSRange)theRange | 185 - (NSRect)firstViewRectForCharacterRange:(NSRange)theRange |
| 186 actualRange:(NSRangePointer)actualRange; | 186 actualRange:(NSRangePointer)actualRange; |
| 187 @end | 187 @end |
| 188 | 188 |
| 189 @interface SoftwareLayer : CALayer { | 189 @interface SoftwareLayer : CALayer |
| 190 @private | |
| 191 content::RenderWidgetHostViewMac* renderWidgetHostView_; | |
| 192 } | |
| 193 | 190 |
| 194 - (id)initWithRenderWidgetHostViewMac:(content::RenderWidgetHostViewMac*)r; | 191 - (id)init; |
| 195 | 192 |
| 196 // Invalidate the RenderWidgetHostViewMac because it may be going away. If | 193 // Remove the layer from the layer hierarchy. |
| 197 // displayed again, it will draw white. | |
| 198 - (void)disableRendering; | 194 - (void)disableRendering; |
| 199 | 195 |
| 200 @end | 196 @end |
| 201 | 197 |
| 202 namespace content { | 198 namespace content { |
| 203 class RenderWidgetHostImpl; | 199 class RenderWidgetHostImpl; |
| 204 | 200 |
| 205 /////////////////////////////////////////////////////////////////////////////// | 201 /////////////////////////////////////////////////////////////////////////////// |
| 206 // RenderWidgetHostViewMac | 202 // RenderWidgetHostViewMac |
| 207 // | 203 // |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 | 360 |
| 365 const std::string& selected_text() const { return selected_text_; } | 361 const std::string& selected_text() const { return selected_text_; } |
| 366 | 362 |
| 367 // Update the IOSurface to be drawn and call setNeedsDisplay on | 363 // Update the IOSurface to be drawn and call setNeedsDisplay on |
| 368 // |cocoa_view_|. | 364 // |cocoa_view_|. |
| 369 void CompositorSwapBuffers(uint64 surface_handle, | 365 void CompositorSwapBuffers(uint64 surface_handle, |
| 370 const gfx::Size& size, | 366 const gfx::Size& size, |
| 371 float scale_factor, | 367 float scale_factor, |
| 372 const std::vector<ui::LatencyInfo>& latency_info); | 368 const std::vector<ui::LatencyInfo>& latency_info); |
| 373 | 369 |
| 370 void GotBrowserCompositorSoftwareFrame(cc::SoftwareFrameData* frame_data, |
| 371 float scale_factor, |
| 372 SkCanvas* canvas); |
| 373 |
| 374 // Draw the IOSurface by making its context current to this view. | 374 // Draw the IOSurface by making its context current to this view. |
| 375 void DrawIOSurfaceWithoutCoreAnimation(); | 375 void DrawIOSurfaceWithoutCoreAnimation(); |
| 376 | 376 |
| 377 // Called when a GPU error is detected. Posts a task to destroy all | 377 // Called when a GPU error is detected. Posts a task to destroy all |
| 378 // compositing state. | 378 // compositing state. |
| 379 void GotAcceleratedCompositingError(); | 379 void GotAcceleratedCompositingError(); |
| 380 | 380 |
| 381 // Sets the overlay view, which should be drawn in the same IOSurface | 381 // Sets the overlay view, which should be drawn in the same IOSurface |
| 382 // atop of this view, if both views are drawing accelerated content. | 382 // atop of this view, if both views are drawing accelerated content. |
| 383 // Overlay is stored as a weak ptr. | 383 // Overlay is stored as a weak ptr. |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 668 scoped_ptr<RenderWidgetHostViewFrameSubscriber> frame_subscriber_; | 668 scoped_ptr<RenderWidgetHostViewFrameSubscriber> frame_subscriber_; |
| 669 | 669 |
| 670 base::WeakPtrFactory<RenderWidgetHostViewMac> | 670 base::WeakPtrFactory<RenderWidgetHostViewMac> |
| 671 software_frame_weak_ptr_factory_; | 671 software_frame_weak_ptr_factory_; |
| 672 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac); | 672 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac); |
| 673 }; | 673 }; |
| 674 | 674 |
| 675 } // namespace content | 675 } // namespace content |
| 676 | 676 |
| 677 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ | 677 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ |
| OLD | NEW |