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

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

Issue 806653006: Update GPU memory buffers to use StrideInBytes internally. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use StrideInBytes Created 6 years 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_MEMORY_H_ 5 #ifndef UI_GL_GL_IMAGE_MEMORY_H_
6 #define UI_GL_GL_IMAGE_MEMORY_H_ 6 #define UI_GL_GL_IMAGE_MEMORY_H_
7 7
8 #include "ui/gl/gl_image.h" 8 #include "ui/gl/gl_image.h"
9 9
10 #if defined(OS_WIN) || defined(USE_X11) || defined(OS_ANDROID) || \ 10 #if defined(OS_WIN) || defined(USE_X11) || defined(OS_ANDROID) || \
11 defined(USE_OZONE) 11 defined(USE_OZONE)
12 #include <EGL/egl.h> 12 #include <EGL/egl.h>
13 #include <EGL/eglext.h> 13 #include <EGL/eglext.h>
14 #endif 14 #endif
15 15
16 #include "ui/gfx/gpu_memory_buffer.h" 16 #include "ui/gfx/gpu_memory_buffer.h"
17 17
18 namespace gfx { 18 namespace gfx {
19 19
20 class GL_EXPORT GLImageMemory : public GLImage { 20 class GL_EXPORT GLImageMemory : public GLImage {
21 public: 21 public:
22 GLImageMemory(const gfx::Size& size, unsigned internalformat); 22 GLImageMemory(const gfx::Size& size, unsigned internalformat);
23 23
24 static size_t BytesPerPixel(gfx::GpuMemoryBuffer::Format format); 24 static size_t StrideInBytes(
25 size_t width, gfx::GpuMemoryBuffer::Format format);
25 26
26 bool Initialize(const unsigned char* memory, 27 bool Initialize(const unsigned char* memory,
27 gfx::GpuMemoryBuffer::Format format); 28 gfx::GpuMemoryBuffer::Format format);
28 29
29 // Overridden from GLImage: 30 // Overridden from GLImage:
30 void Destroy(bool have_context) override; 31 void Destroy(bool have_context) override;
31 gfx::Size GetSize() override; 32 gfx::Size GetSize() override;
32 bool BindTexImage(unsigned target) override; 33 bool BindTexImage(unsigned target) override;
33 void ReleaseTexImage(unsigned target) override {} 34 void ReleaseTexImage(unsigned target) override {}
34 bool CopyTexImage(unsigned target) override; 35 bool CopyTexImage(unsigned target) override;
(...skipping 25 matching lines...) Expand all
60 unsigned egl_texture_id_; 61 unsigned egl_texture_id_;
61 EGLImageKHR egl_image_; 62 EGLImageKHR egl_image_;
62 #endif 63 #endif
63 64
64 DISALLOW_COPY_AND_ASSIGN(GLImageMemory); 65 DISALLOW_COPY_AND_ASSIGN(GLImageMemory);
65 }; 66 };
66 67
67 } // namespace gfx 68 } // namespace gfx
68 69
69 #endif // UI_GL_GL_IMAGE_MEMORY_H_ 70 #endif // UI_GL_GL_IMAGE_MEMORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698