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 // Implementation notes: This needs to work on a variety of hardware | 5 // Implementation notes: This needs to work on a variety of hardware |
6 // configurations where the speed of the CPU and GPU greatly affect overall | 6 // configurations where the speed of the CPU and GPU greatly affect overall |
7 // performance. Spanning several threads, the process of capturing has been | 7 // performance. Spanning several threads, the process of capturing has been |
8 // split up into four conceptual stages: | 8 // split up into four conceptual stages: |
9 // | 9 // |
10 // 1. Reserve Buffer: Before a frame can be captured, a slot in the consumer's | 10 // 1. Reserve Buffer: Before a frame can be captured, a slot in the consumer's |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 | 96 |
97 namespace { | 97 namespace { |
98 | 98 |
99 const int kMinFrameWidth = 2; | 99 const int kMinFrameWidth = 2; |
100 const int kMinFrameHeight = 2; | 100 const int kMinFrameHeight = 2; |
101 const int kMaxFramesInFlight = 2; | 101 const int kMaxFramesInFlight = 2; |
102 const int kMaxSnapshotsInFlight = 1; | 102 const int kMaxSnapshotsInFlight = 1; |
103 | 103 |
104 // TODO(nick): Remove this once frame subscription is supported on Aura and | 104 // TODO(nick): Remove this once frame subscription is supported on Aura and |
105 // Linux. | 105 // Linux. |
106 #if defined(OS_WIN) || defined(OS_MACOSX) | 106 #if (defined(OS_WIN) || defined(OS_MACOSX)) && !defined(USE_AURA) |
107 const bool kAcceleratedSubscriberIsSupported = true; | 107 const bool kAcceleratedSubscriberIsSupported = true; |
108 #else | 108 #else |
109 const bool kAcceleratedSubscriberIsSupported = false; | 109 const bool kAcceleratedSubscriberIsSupported = false; |
110 #endif | 110 #endif |
111 | 111 |
112 typedef base::Callback<void(base::Time, bool)> DeliverFrameCallback; | 112 typedef base::Callback<void(base::Time, bool)> DeliverFrameCallback; |
113 | 113 |
114 // Returns the nearest even integer closer to zero. | 114 // Returns the nearest even integer closer to zero. |
115 template<typename IntType> | 115 template<typename IntType> |
116 IntType MakeEven(IntType x) { | 116 IntType MakeEven(IntType x) { |
(...skipping 1186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1303 return false; | 1303 return false; |
1304 else | 1304 else |
1305 return true; | 1305 return true; |
1306 } | 1306 } |
1307 | 1307 |
1308 base::Time SmoothEventSampler::GetLastSampledEvent() { | 1308 base::Time SmoothEventSampler::GetLastSampledEvent() { |
1309 return last_sample_; | 1309 return last_sample_; |
1310 } | 1310 } |
1311 | 1311 |
1312 } // namespace content | 1312 } // namespace content |
OLD | NEW |