| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_SOFTWARE_FRAME_MANAGER_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_SOFTWARE_FRAME_MANAGER_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_SOFTWARE_FRAME_MANAGER_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_SOFTWARE_FRAME_MANAGER_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 // be evicted. Upon receiving this callback, the client should release any | 32 // be evicted. Upon receiving this callback, the client should release any |
| 33 // references that it may hold to the current frame, to ensure that its memory | 33 // references that it may hold to the current frame, to ensure that its memory |
| 34 // is freed expediently. | 34 // is freed expediently. |
| 35 virtual void ReleaseReferencesToSoftwareFrame() = 0; | 35 virtual void ReleaseReferencesToSoftwareFrame() = 0; |
| 36 }; | 36 }; |
| 37 | 37 |
| 38 class CONTENT_EXPORT SoftwareFrameManager : public RendererFrameManagerClient { | 38 class CONTENT_EXPORT SoftwareFrameManager : public RendererFrameManagerClient { |
| 39 public: | 39 public: |
| 40 explicit SoftwareFrameManager( | 40 explicit SoftwareFrameManager( |
| 41 base::WeakPtr<SoftwareFrameManagerClient> client); | 41 base::WeakPtr<SoftwareFrameManagerClient> client); |
| 42 virtual ~SoftwareFrameManager(); | 42 ~SoftwareFrameManager() override; |
| 43 | 43 |
| 44 // Swaps to a new frame from shared memory. This frame is guaranteed to | 44 // Swaps to a new frame from shared memory. This frame is guaranteed to |
| 45 // not be evicted until SwapToNewFrameComplete is called. | 45 // not be evicted until SwapToNewFrameComplete is called. |
| 46 bool SwapToNewFrame( | 46 bool SwapToNewFrame( |
| 47 uint32 output_surface_id, | 47 uint32 output_surface_id, |
| 48 const cc::SoftwareFrameData* frame_data, | 48 const cc::SoftwareFrameData* frame_data, |
| 49 float frame_device_scale_factor, | 49 float frame_device_scale_factor, |
| 50 base::ProcessHandle process_handle); | 50 base::ProcessHandle process_handle); |
| 51 void SwapToNewFrameComplete(bool visible); | 51 void SwapToNewFrameComplete(bool visible); |
| 52 void SetVisibility(bool visible); | 52 void SetVisibility(bool visible); |
| 53 bool HasCurrentFrame() const; | 53 bool HasCurrentFrame() const; |
| 54 void DiscardCurrentFrame(); | 54 void DiscardCurrentFrame(); |
| 55 uint32 GetCurrentFrameOutputSurfaceId() const; | 55 uint32 GetCurrentFrameOutputSurfaceId() const; |
| 56 void GetCurrentFrameMailbox( | 56 void GetCurrentFrameMailbox( |
| 57 cc::TextureMailbox* mailbox, | 57 cc::TextureMailbox* mailbox, |
| 58 scoped_ptr<cc::SingleReleaseCallback>* callback); | 58 scoped_ptr<cc::SingleReleaseCallback>* callback); |
| 59 void* GetCurrentFramePixels() const; | 59 void* GetCurrentFramePixels() const; |
| 60 float GetCurrentFrameDeviceScaleFactor() const; | 60 float GetCurrentFrameDeviceScaleFactor() const; |
| 61 gfx::Size GetCurrentFrameSizeInPixels() const; | 61 gfx::Size GetCurrentFrameSizeInPixels() const; |
| 62 gfx::Size GetCurrentFrameSizeInDIP() const; | 62 gfx::Size GetCurrentFrameSizeInDIP() const; |
| 63 | 63 |
| 64 private: | 64 private: |
| 65 // Called by SoftwareFrameMemoryManager to demand that the current frame | 65 // Called by SoftwareFrameMemoryManager to demand that the current frame |
| 66 // be evicted. | 66 // be evicted. |
| 67 virtual void EvictCurrentFrame() override; | 67 void EvictCurrentFrame() override; |
| 68 | 68 |
| 69 base::WeakPtr<SoftwareFrameManagerClient> client_; | 69 base::WeakPtr<SoftwareFrameManagerClient> client_; |
| 70 | 70 |
| 71 // This holds the current software framebuffer. | 71 // This holds the current software framebuffer. |
| 72 scoped_refptr<SoftwareFrame> current_frame_; | 72 scoped_refptr<SoftwareFrame> current_frame_; |
| 73 | 73 |
| 74 DISALLOW_COPY_AND_ASSIGN(SoftwareFrameManager); | 74 DISALLOW_COPY_AND_ASSIGN(SoftwareFrameManager); |
| 75 }; | 75 }; |
| 76 | 76 |
| 77 } // namespace content | 77 } // namespace content |
| 78 | 78 |
| 79 #endif // CONTENT_BROWSER_RENDERER_HOST_SOFTWARE_FRAME_MANAGER_H_ | 79 #endif // CONTENT_BROWSER_RENDERER_HOST_SOFTWARE_FRAME_MANAGER_H_ |
| OLD | NEW |