Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(118)

Side by Side Diff: cc/output/output_surface.h

Issue 2612023002: cc: Implement overdraw feedback debugging feature. (Closed)
Patch Set: tracing cleanup Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CC_OUTPUT_OUTPUT_SURFACE_H_ 5 #ifndef CC_OUTPUT_OUTPUT_SURFACE_H_
6 #define CC_OUTPUT_OUTPUT_SURFACE_H_ 6 #define CC_OUTPUT_OUTPUT_SURFACE_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <memory> 9 #include <memory>
10 10
(...skipping 26 matching lines...) Expand all
37 public: 37 public:
38 struct Capabilities { 38 struct Capabilities {
39 Capabilities() = default; 39 Capabilities() = default;
40 40
41 int max_frames_pending = 1; 41 int max_frames_pending = 1;
42 // Whether this output surface renders to the default OpenGL zero 42 // Whether this output surface renders to the default OpenGL zero
43 // framebuffer or to an offscreen framebuffer. 43 // framebuffer or to an offscreen framebuffer.
44 bool uses_default_gl_framebuffer = true; 44 bool uses_default_gl_framebuffer = true;
45 // Whether this OutputSurface is flipped or not. 45 // Whether this OutputSurface is flipped or not.
46 bool flipped_output_surface = false; 46 bool flipped_output_surface = false;
47 // Whether this OutputSurface supports stencil operations or not.
danakj 2017/01/16 16:02:57 Can you mention this is mutually exclusive with Ha
reveman 2017/01/16 18:02:27 Done.
48 bool supports_stencil = false;
47 }; 49 };
48 50
49 // Constructor for GL-based compositing. 51 // Constructor for GL-based compositing.
50 explicit OutputSurface(scoped_refptr<ContextProvider> context_provider); 52 explicit OutputSurface(scoped_refptr<ContextProvider> context_provider);
51 // Constructor for software compositing. 53 // Constructor for software compositing.
52 explicit OutputSurface(std::unique_ptr<SoftwareOutputDevice> software_device); 54 explicit OutputSurface(std::unique_ptr<SoftwareOutputDevice> software_device);
53 // Constructor for Vulkan-based compositing. 55 // Constructor for Vulkan-based compositing.
54 explicit OutputSurface( 56 explicit OutputSurface(
55 scoped_refptr<VulkanContextProvider> vulkan_context_provider); 57 scoped_refptr<VulkanContextProvider> vulkan_context_provider);
56 58
(...skipping 30 matching lines...) Expand all
87 89
88 // Get the texture for the main image's overlay. 90 // Get the texture for the main image's overlay.
89 virtual unsigned GetOverlayTextureId() const = 0; 91 virtual unsigned GetOverlayTextureId() const = 0;
90 92
91 // If this returns true, then the surface will not attempt to draw. 93 // If this returns true, then the surface will not attempt to draw.
92 virtual bool SurfaceIsSuspendForRecycle() const = 0; 94 virtual bool SurfaceIsSuspendForRecycle() const = 0;
93 95
94 virtual void Reshape(const gfx::Size& size, 96 virtual void Reshape(const gfx::Size& size,
95 float device_scale_factor, 97 float device_scale_factor,
96 const gfx::ColorSpace& color_space, 98 const gfx::ColorSpace& color_space,
97 bool has_alpha) = 0; 99 bool has_alpha,
100 bool use_stencil) = 0;
98 101
99 virtual bool HasExternalStencilTest() const = 0; 102 virtual bool HasExternalStencilTest() const = 0;
100 virtual void ApplyExternalStencil() = 0; 103 virtual void ApplyExternalStencil() = 0;
101 104
102 // Gives the GL internal format that should be used for calling CopyTexImage2D 105 // Gives the GL internal format that should be used for calling CopyTexImage2D
103 // when the framebuffer is bound via BindFramebuffer(). 106 // when the framebuffer is bound via BindFramebuffer().
104 virtual uint32_t GetFramebufferCopyTextureFormat() = 0; 107 virtual uint32_t GetFramebufferCopyTextureFormat() = 0;
105 108
106 // Swaps the current backbuffer to the screen. For successful swaps, the 109 // Swaps the current backbuffer to the screen. For successful swaps, the
107 // implementation must call OutputSurfaceClient::DidReceiveSwapBuffersAck() 110 // implementation must call OutputSurfaceClient::DidReceiveSwapBuffersAck()
108 // after returning from this method in order to unblock the next frame. 111 // after returning from this method in order to unblock the next frame.
109 virtual void SwapBuffers(OutputSurfaceFrame frame) = 0; 112 virtual void SwapBuffers(OutputSurfaceFrame frame) = 0;
110 113
111 protected: 114 protected:
112 struct OutputSurface::Capabilities capabilities_; 115 struct OutputSurface::Capabilities capabilities_;
113 scoped_refptr<ContextProvider> context_provider_; 116 scoped_refptr<ContextProvider> context_provider_;
114 scoped_refptr<VulkanContextProvider> vulkan_context_provider_; 117 scoped_refptr<VulkanContextProvider> vulkan_context_provider_;
115 std::unique_ptr<SoftwareOutputDevice> software_device_; 118 std::unique_ptr<SoftwareOutputDevice> software_device_;
116 119
117 private: 120 private:
118 DISALLOW_COPY_AND_ASSIGN(OutputSurface); 121 DISALLOW_COPY_AND_ASSIGN(OutputSurface);
119 }; 122 };
120 123
121 } // namespace cc 124 } // namespace cc
122 125
123 #endif // CC_OUTPUT_OUTPUT_SURFACE_H_ 126 #endif // CC_OUTPUT_OUTPUT_SURFACE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698