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 - (void)setContentsToData:(const void *)data |
197 // displayed again, it will draw white. | 194 withRowBytes:(size_t)rowBytes |
| 195 withPixelSize:(gfx::Size)pixelSize |
| 196 withScaleFactor:(float)scaleFactor; |
| 197 |
| 198 // Remove the layer from the layer hierarchy. |
198 - (void)disableRendering; | 199 - (void)disableRendering; |
199 | 200 |
200 @end | 201 @end |
201 | 202 |
202 namespace content { | 203 namespace content { |
203 class RenderWidgetHostImpl; | 204 class RenderWidgetHostImpl; |
204 | 205 |
205 /////////////////////////////////////////////////////////////////////////////// | 206 /////////////////////////////////////////////////////////////////////////////// |
206 // RenderWidgetHostViewMac | 207 // RenderWidgetHostViewMac |
207 // | 208 // |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 | 365 |
365 const std::string& selected_text() const { return selected_text_; } | 366 const std::string& selected_text() const { return selected_text_; } |
366 | 367 |
367 // Update the IOSurface to be drawn and call setNeedsDisplay on | 368 // Update the IOSurface to be drawn and call setNeedsDisplay on |
368 // |cocoa_view_|. | 369 // |cocoa_view_|. |
369 void CompositorSwapBuffers(uint64 surface_handle, | 370 void CompositorSwapBuffers(uint64 surface_handle, |
370 const gfx::Size& size, | 371 const gfx::Size& size, |
371 float scale_factor, | 372 float scale_factor, |
372 const std::vector<ui::LatencyInfo>& latency_info); | 373 const std::vector<ui::LatencyInfo>& latency_info); |
373 | 374 |
| 375 void GotBrowserCompositorSoftwareFrame(cc::SoftwareFrameData* frame_data, |
| 376 float scale_factor, |
| 377 SkCanvas* canvas); |
| 378 |
374 // Draw the IOSurface by making its context current to this view. | 379 // Draw the IOSurface by making its context current to this view. |
375 void DrawIOSurfaceWithoutCoreAnimation(); | 380 void DrawIOSurfaceWithoutCoreAnimation(); |
376 | 381 |
377 // Called when a GPU error is detected. Posts a task to destroy all | 382 // Called when a GPU error is detected. Posts a task to destroy all |
378 // compositing state. | 383 // compositing state. |
379 void GotAcceleratedCompositingError(); | 384 void GotAcceleratedCompositingError(); |
380 | 385 |
381 // Sets the overlay view, which should be drawn in the same IOSurface | 386 // Sets the overlay view, which should be drawn in the same IOSurface |
382 // atop of this view, if both views are drawing accelerated content. | 387 // atop of this view, if both views are drawing accelerated content. |
383 // Overlay is stored as a weak ptr. | 388 // 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_; | 673 scoped_ptr<RenderWidgetHostViewFrameSubscriber> frame_subscriber_; |
669 | 674 |
670 base::WeakPtrFactory<RenderWidgetHostViewMac> | 675 base::WeakPtrFactory<RenderWidgetHostViewMac> |
671 software_frame_weak_ptr_factory_; | 676 software_frame_weak_ptr_factory_; |
672 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac); | 677 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac); |
673 }; | 678 }; |
674 | 679 |
675 } // namespace content | 680 } // namespace content |
676 | 681 |
677 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ | 682 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ |
OLD | NEW |