summaryrefslogtreecommitdiff
path: root/chromium/cc/output/vulkan_renderer.h
blob: 45b34a847be076e882f1e42e58d1fdbc6911ee38 (plain)
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// Copyright (c) 2016 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 CC_OUTPUT_VULKAN_RENDERER_H_
#define CC_OUTPUT_VULKAN_RENDERER_H_

#include "cc/base/cc_export.h"
#include "cc/output/direct_renderer.h"
#include "ui/events/latency_info.h"

namespace cc {

class TextureMailboxDeleter;

class CC_EXPORT VulkanRenderer : public DirectRenderer {
 public:
  VulkanRenderer(const RendererSettings* settings,
                 OutputSurface* output_surface,
                 ResourceProvider* resource_provider,
                 TextureMailboxDeleter* texture_mailbox_deleter,
                 int highp_threshold_min);
  ~VulkanRenderer() override;

  // Implementation of public DirectRenderer functions.
  void SwapBuffers(std::vector<ui::LatencyInfo> latency_info) override;

 protected:
  // Implementations of protected Renderer functions.
  void DidChangeVisibility() override;

  // Implementations of protected DirectRenderer functions.
  void BindFramebufferToOutputSurface(DrawingFrame* frame) override;
  bool BindFramebufferToTexture(DrawingFrame* frame,
                                const ScopedResource* resource) override;
  void SetScissorTestRect(const gfx::Rect& scissor_rect) override;
  void PrepareSurfaceForPass(DrawingFrame* frame,
                             SurfaceInitializationMode initialization_mode,
                             const gfx::Rect& render_pass_scissor) override;
  void DoDrawQuad(DrawingFrame* frame,
                  const DrawQuad* quad,
                  const gfx::QuadF* clip_region) override;
  void BeginDrawingFrame(DrawingFrame* frame) override;
  void FinishDrawingFrame(DrawingFrame* frame) override;
  void FinishDrawingQuadList() override;
  bool FlippedFramebuffer(const DrawingFrame* frame) const override;
  void EnsureScissorTestEnabled() override;
  void EnsureScissorTestDisabled() override;
  void CopyCurrentRenderPassToBitmap(
      DrawingFrame* frame,
      std::unique_ptr<CopyOutputRequest> request) override;
  bool CanPartialSwap() override;

 private:
  DISALLOW_COPY_AND_ASSIGN(VulkanRenderer);
};

}  // namespace cc

#endif  // CC_OUTPUT_VULKAN_RENDERER_H_