| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_COMPOSITOR_BROWSER_COMPOSITOR_VIEW_PRIVATE_MAC_H_ | 5 #ifndef CONTENT_BROWSER_COMPOSITOR_BROWSER_COMPOSITOR_VIEW_PRIVATE_MAC_H_ |
| 6 #define CONTENT_BROWSER_COMPOSITOR_BROWSER_COMPOSITOR_VIEW_PRIVATE_MAC_H_ | 6 #define CONTENT_BROWSER_COMPOSITOR_BROWSER_COMPOSITOR_VIEW_PRIVATE_MAC_H_ |
| 7 | 7 |
| 8 #include <IOSurface/IOSurfaceAPI.h> | 8 #include <IOSurface/IOSurfaceAPI.h> |
| 9 | 9 |
| 10 #include "base/mac/scoped_nsobject.h" | 10 #include "base/mac/scoped_nsobject.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 uint64 surface_handle, int output_surface_id, | 42 uint64 surface_handle, int output_surface_id, |
| 43 const std::vector<ui::LatencyInfo>& latency_info, | 43 const std::vector<ui::LatencyInfo>& latency_info, |
| 44 gfx::Size pixel_size, float scale_factor); | 44 gfx::Size pixel_size, float scale_factor); |
| 45 | 45 |
| 46 void GotSoftwareFrame( | 46 void GotSoftwareFrame( |
| 47 cc::SoftwareFrameData* frame_data, float scale_factor, SkCanvas* canvas); | 47 cc::SoftwareFrameData* frame_data, float scale_factor, SkCanvas* canvas); |
| 48 | 48 |
| 49 private: | 49 private: |
| 50 // CompositingIOSurfaceLayerClient implementation: | 50 // CompositingIOSurfaceLayerClient implementation: |
| 51 virtual bool AcceleratedLayerShouldAckImmediately() const OVERRIDE; | 51 virtual bool AcceleratedLayerShouldAckImmediately() const OVERRIDE; |
| 52 virtual void AcceleratedLayerDidDrawFrame(bool succeeded) OVERRIDE; | 52 virtual void AcceleratedLayerDidDrawFrame() OVERRIDE; |
| 53 virtual void AcceleratedLayerHitError() OVERRIDE; |
| 53 | 54 |
| 54 void GotAcceleratedCAContextFrame( | 55 void GotAcceleratedCAContextFrame( |
| 55 CAContextID ca_context_id, gfx::Size pixel_size, float scale_factor); | 56 CAContextID ca_context_id, gfx::Size pixel_size, float scale_factor); |
| 56 | 57 |
| 57 void GotAcceleratedIOSurfaceFrame( | 58 void GotAcceleratedIOSurfaceFrame( |
| 58 IOSurfaceID io_surface_id, gfx::Size pixel_size, float scale_factor); | 59 IOSurfaceID io_surface_id, gfx::Size pixel_size, float scale_factor); |
| 59 | 60 |
| 61 // Remove a layer from the heirarchy and destroy it. Because the accelerated |
| 62 // layer types may be replaced by a layer of the same type, the layer to |
| 63 // destroy is parameterized, and, if it is the current layer, the current |
| 64 // layer is reset. |
| 65 void DestroyCAContextLayer( |
| 66 base::scoped_nsobject<CALayerHost> ca_context_layer); |
| 67 void DestroyIOSurfaceLayer( |
| 68 base::scoped_nsobject<CompositingIOSurfaceLayer> io_surface_layer); |
| 69 void DestroySoftwareLayer(); |
| 70 |
| 60 // The client of the BrowserCompositorViewMac that is using this as its | 71 // The client of the BrowserCompositorViewMac that is using this as its |
| 61 // internals. | 72 // internals. |
| 62 BrowserCompositorViewMacClient* client_; | 73 BrowserCompositorViewMacClient* client_; |
| 63 | 74 |
| 64 // A phony NSView handle used to identify this. | 75 // A phony NSView handle used to identify this. |
| 65 gfx::AcceleratedWidget native_widget_; | 76 gfx::AcceleratedWidget native_widget_; |
| 66 | 77 |
| 67 // The compositor drawing the contents of this view. | 78 // The compositor drawing the contents of this view. |
| 68 scoped_ptr<ui::Compositor> compositor_; | 79 scoped_ptr<ui::Compositor> compositor_; |
| 69 | 80 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 91 int accelerated_output_surface_id_; | 102 int accelerated_output_surface_id_; |
| 92 std::vector<ui::LatencyInfo> accelerated_latency_info_; | 103 std::vector<ui::LatencyInfo> accelerated_latency_info_; |
| 93 | 104 |
| 94 // The size in DIP of the last swap received from |compositor_|. | 105 // The size in DIP of the last swap received from |compositor_|. |
| 95 gfx::Size last_swap_size_dip_; | 106 gfx::Size last_swap_size_dip_; |
| 96 }; | 107 }; |
| 97 | 108 |
| 98 } // namespace content | 109 } // namespace content |
| 99 | 110 |
| 100 #endif // CONTENT_BROWSER_COMPOSITOR_BROWSER_COMPOSITOR_VIEW_PRIVATE_MAC_H_ | 111 #endif // CONTENT_BROWSER_COMPOSITOR_BROWSER_COMPOSITOR_VIEW_PRIVATE_MAC_H_ |
| OLD | NEW |