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

Side by Side Diff: ui/gl/gl_image_io_surface.h

Issue 1870483003: Add command buffer support for GL_RGB CHROMIUM image emulation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add missing braces. Created 4 years, 8 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
« no previous file with comments | « ui/gl/gl_image.cc ('k') | ui/gl/gl_image_io_surface.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 UI_GL_GL_IMAGE_IO_SURFACE_H_ 5 #ifndef UI_GL_GL_IMAGE_IO_SURFACE_H_
6 #define UI_GL_GL_IMAGE_IO_SURFACE_H_ 6 #define UI_GL_GL_IMAGE_IO_SURFACE_H_
7 7
8 #include <CoreVideo/CVPixelBuffer.h> 8 #include <CoreVideo/CVPixelBuffer.h>
9 #include <IOSurface/IOSurface.h> 9 #include <IOSurface/IOSurface.h>
10 #include <stdint.h> 10 #include <stdint.h>
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 const gfx::Point& offset, 51 const gfx::Point& offset,
52 const gfx::Rect& rect) override; 52 const gfx::Rect& rect) override;
53 bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget, 53 bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget,
54 int z_order, 54 int z_order,
55 gfx::OverlayTransform transform, 55 gfx::OverlayTransform transform,
56 const gfx::Rect& bounds_rect, 56 const gfx::Rect& bounds_rect,
57 const gfx::RectF& crop_rect) override; 57 const gfx::RectF& crop_rect) override;
58 void OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd, 58 void OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd,
59 uint64_t process_tracing_id, 59 uint64_t process_tracing_id,
60 const std::string& dump_name) override; 60 const std::string& dump_name) override;
61 bool EmulatingRGB() const override;
61 62
62 gfx::GenericSharedMemoryId io_surface_id() const { return io_surface_id_; } 63 gfx::GenericSharedMemoryId io_surface_id() const { return io_surface_id_; }
63 base::ScopedCFTypeRef<IOSurfaceRef> io_surface(); 64 base::ScopedCFTypeRef<IOSurfaceRef> io_surface();
64 base::ScopedCFTypeRef<CVPixelBufferRef> cv_pixel_buffer(); 65 base::ScopedCFTypeRef<CVPixelBufferRef> cv_pixel_buffer();
65 66
66 static unsigned GetInternalFormatForTesting(gfx::BufferFormat format); 67 static unsigned GetInternalFormatForTesting(gfx::BufferFormat format);
67 68
68 protected: 69 protected:
69 ~GLImageIOSurface() override; 70 ~GLImageIOSurface() override;
70 71
71 private: 72 private:
72 class RGBConverter; 73 class RGBConverter;
73 74
74 const gfx::Size size_; 75 const gfx::Size size_;
76
77 // The "internalformat" exposed to the command buffer, which may not be
78 // "internalformat" requested by the client.
75 const unsigned internalformat_; 79 const unsigned internalformat_;
80
81 // The "internalformat" requested by the client.
82 const unsigned client_internalformat_;
83
76 gfx::BufferFormat format_; 84 gfx::BufferFormat format_;
77 base::ScopedCFTypeRef<IOSurfaceRef> io_surface_; 85 base::ScopedCFTypeRef<IOSurfaceRef> io_surface_;
78 base::ScopedCFTypeRef<CVPixelBufferRef> cv_pixel_buffer_; 86 base::ScopedCFTypeRef<CVPixelBufferRef> cv_pixel_buffer_;
79 gfx::GenericSharedMemoryId io_surface_id_; 87 gfx::GenericSharedMemoryId io_surface_id_;
80 base::ThreadChecker thread_checker_; 88 base::ThreadChecker thread_checker_;
81 89
82 // GL state to support 420v IOSurface conversion to RGB. This is retained 90 // GL state to support 420v IOSurface conversion to RGB. This is retained
83 // to avoid re-creating the necessary GL programs every frame. 91 // to avoid re-creating the necessary GL programs every frame.
84 scoped_refptr<RGBConverter> rgb_converter_; 92 scoped_refptr<RGBConverter> rgb_converter_;
85 93
86 DISALLOW_COPY_AND_ASSIGN(GLImageIOSurface); 94 DISALLOW_COPY_AND_ASSIGN(GLImageIOSurface);
87 }; 95 };
88 96
89 } // namespace gl 97 } // namespace gl
90 98
91 #endif // UI_GL_GL_IMAGE_IO_SURFACE_H_ 99 #endif // UI_GL_GL_IMAGE_IO_SURFACE_H_
OLDNEW
« no previous file with comments | « ui/gl/gl_image.cc ('k') | ui/gl/gl_image_io_surface.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698