~abreu-alexandre/oxide/remove-chromedriver-build

« back to all changes in this revision

Viewing changes to shared/browser/compositor/oxide_compositor_output_surface_gl.h

  • Committer: Chris Coulson
  • Date: 2016-02-26 18:27:48 UTC
  • Revision ID: chris.coulson@canonical.com-20160226182748-bqhc23qxs09cpg33
Switch to a single-threaded webview compositor

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
// vim:expandtab:shiftwidth=2:tabstop=2:
2
 
// Copyright (C) 2014-2015 Canonical Ltd.
 
2
// Copyright (C) 2014-2016 Canonical Ltd.
3
3
 
4
4
// This library is free software; you can redistribute it and/or
5
5
// modify it under the terms of the GNU Lesser General Public
21
21
#include <deque>
22
22
#include <queue>
23
23
 
24
 
#include "base/compiler_specific.h"
25
24
#include "base/macros.h"
26
25
#include "gpu/command_buffer/common/mailbox.h"
27
26
#include "ui/gfx/geometry/size.h"
35
34
  CompositorOutputSurfaceGL(
36
35
      uint32_t surface_id,
37
36
      scoped_refptr<cc::ContextProvider> context_provider,
38
 
      scoped_refptr<CompositorThreadProxy> proxy);
 
37
      scoped_refptr<CompositorProxy> proxy);
39
38
  ~CompositorOutputSurfaceGL();
40
39
 
41
40
 private:
42
41
  // cc::OutputSurface implementation
43
 
  void DetachFromDisplayClient() override;
44
42
  void EnsureBackbuffer() override;
45
43
  void DiscardBackbuffer() override;
46
44
  void Reshape(const gfx::Size& size,
53
51
  void ReclaimResources(const CompositorFrameAck& ack) override;
54
52
 
55
53
  struct BufferData {
56
 
    BufferData() : texture_id(0), sync_point(0) {}
 
54
    BufferData() : texture_id(0), available(true) {}
57
55
 
58
56
    uint32_t texture_id;
59
57
    gpu::Mailbox mailbox;
60
58
    gfx::Size size;
61
 
    uint32_t sync_point;
 
59
    bool available;
62
60
  };
63
61
 
64
 
  void DiscardBuffer(BufferData* buffer);
 
62
  BufferData& GetBufferDataForMailbox(const gpu::Mailbox& mailbox);
 
63
  void DiscardBufferIfPossible(BufferData* buffer);
65
64
 
66
 
  BufferData back_buffer_;
67
 
  std::deque<BufferData> pending_buffers_;
68
 
  std::queue<BufferData> returned_buffers_;
 
65
  BufferData* back_buffer_;
 
66
  std::array<BufferData, 2> buffers_;
69
67
 
70
68
  bool is_backbuffer_discarded_;
71
69
  uint32_t fbo_;