diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-09-18 14:34:04 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-10-04 11:15:27 +0000 |
commit | e6430e577f105ad8813c92e75c54660c4985026e (patch) | |
tree | 88115e5d1fb471fea807111924dcccbeadbf9e4f /chromium/media/gpu/android/promotion_hint_aggregator.h | |
parent | 53d399fe6415a96ea6986ec0d402a9c07da72453 (diff) | |
download | qtwebengine-chromium-e6430e577f105ad8813c92e75c54660c4985026e.tar.gz |
BASELINE: Update Chromium to 61.0.3163.99
Change-Id: I8452f34574d88ca2b27af9bd56fc9ff3f16b1367
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'chromium/media/gpu/android/promotion_hint_aggregator.h')
-rw-r--r-- | chromium/media/gpu/android/promotion_hint_aggregator.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/chromium/media/gpu/android/promotion_hint_aggregator.h b/chromium/media/gpu/android/promotion_hint_aggregator.h new file mode 100644 index 00000000000..44e55614701 --- /dev/null +++ b/chromium/media/gpu/android/promotion_hint_aggregator.h @@ -0,0 +1,41 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef MEDIA_GPU_ANDROID_PROMOTION_HINT_AGGREGATOR_H_ +#define MEDIA_GPU_ANDROID_PROMOTION_HINT_AGGREGATOR_H_ + +#include "base/bind.h" +#include "base/callback.h" +#include "base/macros.h" +#include "media/gpu/media_gpu_export.h" + +namespace media { + +// Receive lots of promotion hints, and aggregate them into a single signal. A +// promotion hint is feedback from the compositor about whether a quad could be +// promoted to an overlay, or whether the compositor would refuse to do so. +// For example, the compositor won't promote a quad that's rotated, since an +// overlay can't do that. +class MEDIA_GPU_EXPORT PromotionHintAggregator { + public: + struct Hint { + int x = 0; + int y = 0; + bool is_promotable = false; + }; + + using NotifyPromotionHintCB = base::Callback<void(const Hint& hint)>; + + virtual ~PromotionHintAggregator() = default; + + // Notify us that an image has / would be drawn with the given hint. + virtual void NotifyPromotionHint(const Hint& hint) = 0; + + // Returns true if and only if it's probably okay to promote the video. + virtual bool IsSafeToPromote() = 0; +}; + +} // namespace media + +#endif // MEDIA_GPU_ANDROID_PROMOTION_HINT_AGGREGATOR_H_ |