From e6430e577f105ad8813c92e75c54660c4985026e Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 18 Sep 2017 14:34:04 +0200 Subject: BASELINE: Update Chromium to 61.0.3163.99 Change-Id: I8452f34574d88ca2b27af9bd56fc9ff3f16b1367 Reviewed-by: Alexandru Croitor --- .../media/gpu/android/promotion_hint_aggregator.h | 41 ++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 chromium/media/gpu/android/promotion_hint_aggregator.h (limited to 'chromium/media/gpu/android/promotion_hint_aggregator.h') 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; + + 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_ -- cgit v1.2.1