| Index: cc/output/overlay_processor.cc
|
| diff --git a/cc/output/overlay_processor.cc b/cc/output/overlay_processor.cc
|
| index 7996ce6789f5c0eb20c6acb1641848028a149cfd..28a4c312ce725e4eade760873c429bb40cec2b9a 100644
|
| --- a/cc/output/overlay_processor.cc
|
| +++ b/cc/output/overlay_processor.cc
|
| @@ -8,9 +8,35 @@
|
| #include "cc/output/overlay_strategy_single_on_top.h"
|
| #include "cc/output/overlay_strategy_underlay.h"
|
| #include "cc/quads/draw_quad.h"
|
| +#include "cc/resources/resource_provider.h"
|
| #include "ui/gfx/geometry/rect_conversions.h"
|
| #include "ui/gfx/transform.h"
|
|
|
| +namespace {
|
| +
|
| +// Utility class to make sure that we notify resource that they're promotable
|
| +// before returning from ProcessForOverlays.
|
| +class NotifyPromotionsBeforeReturning {
|
| + public:
|
| + NotifyPromotionsBeforeReturning(cc::ResourceProvider* resource_provider,
|
| + cc::OverlayCandidateList* candidates)
|
| + : resource_provider_(resource_provider), candidates_(candidates) {}
|
| + ~NotifyPromotionsBeforeReturning() {
|
| +#if defined(OS_ANDROID)
|
| + resource_provider_->SendPromotionHints(
|
| + candidates_->promotable_resource_hints_);
|
| +#endif
|
| + }
|
| +
|
| + private:
|
| + cc::ResourceProvider* resource_provider_;
|
| + cc::OverlayCandidateList* candidates_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(NotifyPromotionsBeforeReturning);
|
| +};
|
| +
|
| +} // namespace
|
| +
|
| namespace cc {
|
|
|
| OverlayProcessor::OverlayProcessor(OutputSurface* surface) : surface_(surface) {
|
| @@ -62,6 +88,13 @@ void OverlayProcessor::ProcessForOverlays(ResourceProvider* resource_provider,
|
| OverlayCandidateList* candidates,
|
| CALayerOverlayList* ca_layer_overlays,
|
| gfx::Rect* damage_rect) {
|
| + // Be sure to send out notifications, regardless of whether we get to
|
| + // processing for overlays or not. If we don't, then we should notify that
|
| + // they are not promotable.
|
| + // TODO(liberato): should we only notify 'yes' instances, and make the
|
| + // glimage infer the 'no' instances? that seems flaky, though.
|
| + NotifyPromotionsBeforeReturning notify(resource_provider, candidates);
|
| +
|
| // If we have any copy requests, we can't remove any quads for overlays or
|
| // CALayers because the framebuffer would be missing the removed quads'
|
| // contents.
|
|
|