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

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

Issue 1830453002: WebGL: GL_RGB emulation for IOSurface backed textures. [For reference only] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Compile error. Created 4 years, 9 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_glx.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 <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_;
65 const unsigned internalformat_; 66 unsigned internalformat_;
67
68 // This class is capable of emulating RGB internal format with RGBA
69 // internal format. The member |internalformat_| holds the format
70 // exposed to the command buffer. |desired_internalformat_| holds the format
71 // desired by the caller of the constructor of this object.
72 const unsigned desired_internalformat_;
66 gfx::BufferFormat format_; 73 gfx::BufferFormat format_;
67 base::ScopedCFTypeRef<IOSurfaceRef> io_surface_; 74 base::ScopedCFTypeRef<IOSurfaceRef> io_surface_;
68 gfx::GenericSharedMemoryId io_surface_id_; 75 gfx::GenericSharedMemoryId io_surface_id_;
69 base::ThreadChecker thread_checker_; 76 base::ThreadChecker thread_checker_;
70 77
71 // GL state to support 420v IOSurface conversion to RGB. 78 // GL state to support 420v IOSurface conversion to RGB.
72 unsigned framebuffer_ = 0; 79 unsigned framebuffer_ = 0;
73 unsigned vertex_shader_ = 0; 80 unsigned vertex_shader_ = 0;
74 unsigned fragment_shader_ = 0; 81 unsigned fragment_shader_ = 0;
75 unsigned program_ = 0; 82 unsigned program_ = 0;
76 int size_location_ = -1; 83 int size_location_ = -1;
77 unsigned vertex_buffer_ = 0; 84 unsigned vertex_buffer_ = 0;
78 unsigned yuv_textures_[2] = {}; 85 unsigned yuv_textures_[2] = {};
79 86
80 DISALLOW_COPY_AND_ASSIGN(GLImageIOSurface); 87 DISALLOW_COPY_AND_ASSIGN(GLImageIOSurface);
81 }; 88 };
82 89
83 } // namespace gl 90 } // namespace gl
84 91
85 #endif // UI_GL_GL_IMAGE_IO_SURFACE_H_ 92 #endif // UI_GL_GL_IMAGE_IO_SURFACE_H_
OLDNEW
« no previous file with comments | « ui/gl/gl_image_glx.cc ('k') | ui/gl/gl_image_io_surface.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698