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

Side by Side Diff: content/common/gpu/client/gpu_memory_buffer_impl_surface_texture.cc

Issue 255713008: Change glimage to accept a type. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | Annotate | Revision Log
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 #include "content/common/gpu/client/gpu_memory_buffer_impl_surface_texture.h" 5 #include "content/common/gpu/client/gpu_memory_buffer_impl_surface_texture.h"
6 6
7 #include "base/debug/trace_event.h" 7 #include "base/debug/trace_event.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "content/common/android/surface_texture_lookup.h" 9 #include "content/common/android/surface_texture_lookup.h"
10 #include "ui/gl/gl_bindings.h" 10 #include "ui/gl/gl_bindings.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 58
59 ANativeWindow_setBuffersGeometry(native_window_, 59 ANativeWindow_setBuffersGeometry(native_window_,
60 size_.width(), 60 size_.width(),
61 size_.height(), 61 size_.height(),
62 WindowFormat(internalformat_)); 62 WindowFormat(internalformat_));
63 63
64 surface_texture_id_ = handle.surface_texture_id; 64 surface_texture_id_ = handle.surface_texture_id;
65 return true; 65 return true;
66 } 66 }
67 67
68 void* GpuMemoryBufferImplSurfaceTexture::Map(AccessMode mode) { 68 void* GpuMemoryBufferImplSurfaceTexture::Map() {
69 TRACE_EVENT0("gpu", "GpuMemoryBufferImplSurfaceTexture::Map"); 69 TRACE_EVENT0("gpu", "GpuMemoryBufferImplSurfaceTexture::Map");
70 70
71 DCHECK(!mapped_); 71 DCHECK(!mapped_);
72 DCHECK(native_window_); 72 DCHECK(native_window_);
73 ANativeWindow_Buffer buffer; 73 ANativeWindow_Buffer buffer;
74 int status = ANativeWindow_lock(native_window_, &buffer, NULL); 74 int status = ANativeWindow_lock(native_window_, &buffer, NULL);
75 if (status) { 75 if (status) {
76 VLOG(1) << "ANativeWindow_lock failed with error code: " << status; 76 VLOG(1) << "ANativeWindow_lock failed with error code: " << status;
77 return NULL; 77 return NULL;
78 } 78 }
(...skipping 16 matching lines...) Expand all
95 95
96 gfx::GpuMemoryBufferHandle GpuMemoryBufferImplSurfaceTexture::GetHandle() 96 gfx::GpuMemoryBufferHandle GpuMemoryBufferImplSurfaceTexture::GetHandle()
97 const { 97 const {
98 gfx::GpuMemoryBufferHandle handle; 98 gfx::GpuMemoryBufferHandle handle;
99 handle.type = gfx::SURFACE_TEXTURE_BUFFER; 99 handle.type = gfx::SURFACE_TEXTURE_BUFFER;
100 handle.surface_texture_id = surface_texture_id_; 100 handle.surface_texture_id = surface_texture_id_;
101 return handle; 101 return handle;
102 } 102 }
103 103
104 } // namespace content 104 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698