1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31
   32
   33
   34
   35
   36
   37
   38
   39
   40
   41

android_webview / browser / gfx / compositor_frame_producer.h [blame]

// Copyright 2016 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef ANDROID_WEBVIEW_BROWSER_GFX_COMPOSITOR_FRAME_PRODUCER_H_
#define ANDROID_WEBVIEW_BROWSER_GFX_COMPOSITOR_FRAME_PRODUCER_H_

#include <vector>

#include "base/memory/weak_ptr.h"
#include "components/viz/common/resources/returned_resource.h"

namespace viz {
class FrameSinkId;
}

namespace android_webview {

class CompositorFrameConsumer;

class CompositorFrameProducer {
 public:
  virtual base::WeakPtr<CompositorFrameProducer> GetWeakPtr() = 0;
  virtual void ReturnUsedResources(std::vector<viz::ReturnedResource> resources,
                                   const viz::FrameSinkId& frame_sink_id,
                                   uint32_t layer_tree_frame_sink_id) = 0;
  virtual void OnParentDrawDataUpdated(
      CompositorFrameConsumer* compositor_frame_consumer) = 0;
  virtual void OnViewTreeForceDarkStateChanged(
      bool view_tree_force_dark_state) = 0;
  virtual void RemoveCompositorFrameConsumer(
      CompositorFrameConsumer* consumer) = 0;
  virtual void ChildSurfaceWasEvicted() = 0;

 protected:
  virtual ~CompositorFrameProducer() {}
};

}  // namespace android_webview

#endif  // ANDROID_WEBVIEW_BROWSER_GFX_COMPOSITOR_FRAME_PRODUCER_H_