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

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: 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
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 <IOSurface/IOSurface.h> 8 #include <IOSurface/IOSurface.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 const gfx::Point& offset, 42 const gfx::Point& offset,
43 const gfx::Rect& rect) override; 43 const gfx::Rect& rect) override;
44 bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget, 44 bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget,
45 int z_order, 45 int z_order,
46 gfx::OverlayTransform transform, 46 gfx::OverlayTransform transform,
47 const gfx::Rect& bounds_rect, 47 const gfx::Rect& bounds_rect,
48 const gfx::RectF& crop_rect) override; 48 const gfx::RectF& crop_rect) override;
49 void OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd, 49 void OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd,
50 uint64_t process_tracing_id, 50 uint64_t process_tracing_id,
51 const std::string& dump_name) override; 51 const std::string& dump_name) override;
52 bool EmulatingRGB() const override;
52 53
53 gfx::GenericSharedMemoryId io_surface_id() const { return io_surface_id_; } 54 gfx::GenericSharedMemoryId io_surface_id() const { return io_surface_id_; }
54 base::ScopedCFTypeRef<IOSurfaceRef> io_surface(); 55 base::ScopedCFTypeRef<IOSurfaceRef> io_surface();
55 56
56 static void SetLayerForWidget(gfx::AcceleratedWidget widget, CALayer* layer); 57 static void SetLayerForWidget(gfx::AcceleratedWidget widget, CALayer* layer);
57 58
58 static unsigned GetInternalFormatForTesting(gfx::BufferFormat format); 59 static unsigned GetInternalFormatForTesting(gfx::BufferFormat format);
59 60
60 protected: 61 protected:
61 ~GLImageIOSurface() override; 62 ~GLImageIOSurface() override;
62 63
63 private: 64 private:
64 const gfx::Size size_; 65 const gfx::Size size_;
66
67 // The "internalformat" exposed to the command buffer, which may not be
68 // "internalformat" requested by the client.
65 const unsigned internalformat_; 69 const unsigned internalformat_;
70
71 // The "internalformat" requested by the client.
72 const unsigned client_internalformat_;
73
66 gfx::BufferFormat format_; 74 gfx::BufferFormat format_;
67 base::ScopedCFTypeRef<IOSurfaceRef> io_surface_; 75 base::ScopedCFTypeRef<IOSurfaceRef> io_surface_;
68 gfx::GenericSharedMemoryId io_surface_id_; 76 gfx::GenericSharedMemoryId io_surface_id_;
69 base::ThreadChecker thread_checker_; 77 base::ThreadChecker thread_checker_;
70 78
71 // GL state to support 420v IOSurface conversion to RGB. 79 // GL state to support 420v IOSurface conversion to RGB.
72 unsigned framebuffer_ = 0; 80 unsigned framebuffer_ = 0;
73 unsigned vertex_shader_ = 0; 81 unsigned vertex_shader_ = 0;
74 unsigned fragment_shader_ = 0; 82 unsigned fragment_shader_ = 0;
75 unsigned program_ = 0; 83 unsigned program_ = 0;
76 int size_location_ = -1; 84 int size_location_ = -1;
77 unsigned vertex_buffer_ = 0; 85 unsigned vertex_buffer_ = 0;
78 unsigned yuv_textures_[2] = {}; 86 unsigned yuv_textures_[2] = {};
79 87
80 DISALLOW_COPY_AND_ASSIGN(GLImageIOSurface); 88 DISALLOW_COPY_AND_ASSIGN(GLImageIOSurface);
81 }; 89 };
82 90
83 } // namespace gl 91 } // namespace gl
84 92
85 #endif // UI_GL_GL_IMAGE_IO_SURFACE_H_ 93 #endif // UI_GL_GL_IMAGE_IO_SURFACE_H_
OLDNEW
« ui/gl/gl_image.h ('K') | « 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