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: content/common/gpu/client/gpu_memory_buffer_impl_surface_texture.h

Issue 177953004: Enable SurfaceTexture based zero-copy texture uploading on Android platform Base URL: http://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 10 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_SURFACE_TEXTURE_H_
6 #define CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_SURFACE_TEXTURE_H_
7
8 #include "content/common/gpu/client/gpu_memory_buffer_impl.h"
9 #include "ui/gl/android/surface_texture.h"
10
11 namespace content {
12
13 // Provides implementation of a GPU memory buffer based
14 // on SurfaceTexture.
15 class GpuMemoryBufferImplSurfaceTexture : public GpuMemoryBufferImpl {
16 public:
17 GpuMemoryBufferImplSurfaceTexture(gfx::Size size, unsigned internalformat);
18 virtual ~GpuMemoryBufferImplSurfaceTexture();
19
20 bool Initialize(gfx::GpuMemoryBufferHandle handle);
21
22 // Overridden from gfx::GpuMemoryBuffer:
23 virtual uint32 GetStride() const OVERRIDE;
24 virtual void Map(AccessMode mode, void** vaddr) OVERRIDE;
25 virtual void Unmap() OVERRIDE;
26 virtual gfx::GpuMemoryBufferHandle GetHandle() const OVERRIDE;
27 void setSurfaceTexture(gfx::SurfaceTexture* surface_texture) {
28 surface_texture_ = surface_texture;
29 }
30 void setNativeWindow(ANativeWindow* window);
31
32 private:
33 unsigned int texture_id_;
34 ANativeWindow* native_window_;
35 unsigned int stride_;
36 bool stride_updated_;
37 gfx::SurfaceTexture* surface_texture_;
38
39 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferImplSurfaceTexture);
40 };
41
42 } // namespace content
43
44 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_SURFACE_TEXTURE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698