| 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_PUBLIC_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_H_ | 6 #define CONTENT_PUBLIC_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
| 10 #include "gpu/command_buffer/service/in_process_command_buffer.h" | 10 #include "gpu/command_buffer/service/in_process_command_buffer.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 // Allows changing or resetting the client to NULL (this must be used if | 57 // Allows changing or resetting the client to NULL (this must be used if |
| 58 // the client is being deleted prior to the DidDestroyCompositor() call | 58 // the client is being deleted prior to the DidDestroyCompositor() call |
| 59 // being received by the client). Ownership of |client| remains with | 59 // being received by the client). Ownership of |client| remains with |
| 60 // the caller. | 60 // the caller. |
| 61 virtual void SetClient(SynchronousCompositorClient* client) = 0; | 61 virtual void SetClient(SynchronousCompositorClient* client) = 0; |
| 62 | 62 |
| 63 static void SetGpuService( | 63 static void SetGpuService( |
| 64 scoped_refptr<gpu::InProcessCommandBuffer::Service> service); | 64 scoped_refptr<gpu::InProcessCommandBuffer::Service> service); |
| 65 | 65 |
| 66 // By default, synchronous compopsitor records the full layer, not only | 66 // By default, synchronous compopsitor records the full layer, not only |
| 67 // what is inside and around the view port. Call this on start up to revert | 67 // what is inside and around the view port. This can be used to switch |
| 68 // to default behavior when synchronous compositor is not used. | 68 // between this record-full-layer behavior and normal record-around-viewport |
| 69 static void DisableRecordFullLayer(); | 69 // behavior. |
| 70 static void SetRecordFullDocument(bool record_full_document); |
| 70 | 71 |
| 71 // Synchronously initialize compositor for hardware draw. Can only be called | 72 // Synchronously initialize compositor for hardware draw. Can only be called |
| 72 // while compositor is in software only mode, either after compositor is | 73 // while compositor is in software only mode, either after compositor is |
| 73 // first created or after ReleaseHwDraw is called. It is invalid to | 74 // first created or after ReleaseHwDraw is called. It is invalid to |
| 74 // DemandDrawHw before this returns true. | 75 // DemandDrawHw before this returns true. |
| 75 virtual bool InitializeHwDraw() = 0; | 76 virtual bool InitializeHwDraw() = 0; |
| 76 | 77 |
| 77 // Reverse of InitializeHwDraw above. Can only be called while hardware draw | 78 // Reverse of InitializeHwDraw above. Can only be called while hardware draw |
| 78 // is already initialized. Brings compositor back to software only mode and | 79 // is already initialized. Brings compositor back to software only mode and |
| 79 // releases all hardware resources. | 80 // releases all hardware resources. |
| (...skipping 29 matching lines...) Expand all Loading... |
| 109 // SynchronousCompositorClient::GetTotalRootLayerScrollOffset). | 110 // SynchronousCompositorClient::GetTotalRootLayerScrollOffset). |
| 110 virtual void DidChangeRootLayerScrollOffset() = 0; | 111 virtual void DidChangeRootLayerScrollOffset() = 0; |
| 111 | 112 |
| 112 protected: | 113 protected: |
| 113 virtual ~SynchronousCompositor() {} | 114 virtual ~SynchronousCompositor() {} |
| 114 }; | 115 }; |
| 115 | 116 |
| 116 } // namespace content | 117 } // namespace content |
| 117 | 118 |
| 118 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_H_ | 119 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_H_ |
| OLD | NEW |