 Chromium Code Reviews
 Chromium Code Reviews Issue 1258713002:
  ozone: unify GpuMemoryBufferFactoryOzoneNativePixmap in content/  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master
    
  
    Issue 1258713002:
  ozone: unify GpuMemoryBufferFactoryOzoneNativePixmap in content/  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master| Index: ui/gl/gl_image_ozone_native_pixmap.h | 
| diff --git a/ui/gl/gl_image_ozone_native_pixmap.h b/ui/gl/gl_image_ozone_native_pixmap.h | 
| new file mode 100644 | 
| index 0000000000000000000000000000000000000000..f25058839854d3cd970ef740427d8e53e22a58d8 | 
| --- /dev/null | 
| +++ b/ui/gl/gl_image_ozone_native_pixmap.h | 
| @@ -0,0 +1,57 @@ | 
| +// Copyright 2015 The Chromium Authors. All rights reserved. | 
| +// Use of this source code is governed by a BSD-style license that can be | 
| +// found in the LICENSE file. | 
| + | 
| +#ifndef UI_GL_GL_IMAGE_OZONE_NATIVE_PIXMAP_H_ | 
| +#define UI_GL_GL_IMAGE_OZONE_NATIVE_PIXMAP_H_ | 
| + | 
| +#include "ui/gfx/gpu_memory_buffer.h" | 
| +#include "ui/gl/gl_image.h" | 
| +#include "ui/ozone/public/native_pixmap.h" | 
| + | 
| +namespace gfx { | 
| + | 
| +class GL_EXPORT GLImageOzoneNativePixmap : public GLImage { | 
| 
reveman
2015/07/28 14:40:57
While it might not be ideal we currently use inher
 
dshwang
2015/07/28 16:21:55
GLImageOzoneNativePixmap inherits GLImageLinuxDMAB
 
spang
2015/07/28 19:34:27
This is an abuse of inheritance.
I don't think we
 
dshwang
2015/07/29 13:23:09
Got it. It's same opinion to reveman's. I did make
 | 
| + public: | 
| + static scoped_refptr<GLImageOzoneNativePixmap> Create( | 
| + scoped_refptr<ui::NativePixmap> pixmap, | 
| + const Size& size, | 
| + GpuMemoryBuffer::Format format, | 
| + unsigned internalformat); | 
| 
reveman
2015/07/28 14:40:57
Some consistency requests:
Please remove this Cre
 
dshwang
2015/07/28 16:21:55
Thank you for detailed explanation. Done.
 | 
| + | 
| + void Destroy(bool have_context) override; | 
| + Size GetSize() override; | 
| + unsigned GetInternalFormat() override; | 
| + bool BindTexImage(unsigned target) override; | 
| + void ReleaseTexImage(unsigned target) override; | 
| + bool CopyTexSubImage(unsigned target, | 
| + const Point& offset, | 
| + const Rect& rect) override; | 
| + void WillUseTexImage() override; | 
| + void DidUseTexImage() override; | 
| + void WillModifyTexImage() override; | 
| + void DidModifyTexImage() override; | 
| + bool ScheduleOverlayPlane(AcceleratedWidget widget, | 
| + int z_order, | 
| + OverlayTransform transform, | 
| + const Rect& bounds_rect, | 
| + const RectF& crop_rect); | 
| + | 
| + private: | 
| + GLImageOzoneNativePixmap(scoped_refptr<ui::NativePixmap> pixmap, | 
| + const Size& size, | 
| + GpuMemoryBuffer::Format format, | 
| + unsigned internalformat); | 
| + ~GLImageOzoneNativePixmap() override; | 
| + bool Initialize(); | 
| + | 
| + scoped_refptr<ui::NativePixmap> pixmap_; | 
| + const Size size_; | 
| + GpuMemoryBuffer::Format format_; | 
| + unsigned internalformat_; | 
| + scoped_refptr<GLImage> image_; | 
| +}; | 
| + | 
| +} // namespace gfx | 
| + | 
| +#endif // UI_GL_GL_IMAGE_OZONE_NATIVE_PIXMAP_H_ |