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

Side by Side Diff: components/mus/gles2/mojo_gpu_memory_buffer.cc

Issue 1403283007: Re-land: ui: Add custom stride support to GLImageMemory. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more missing static_casts Created 5 years, 1 month 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/mus/gles2/mojo_gpu_memory_buffer.h" 5 #include "components/mus/gles2/mojo_gpu_memory_buffer.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/shared_memory.h" 8 #include "base/memory/shared_memory.h"
9 #include "base/numerics/safe_conversions.h" 9 #include "base/numerics/safe_conversions.h"
10 #include "ui/gfx/buffer_format_util.h" 10 #include "ui/gfx/buffer_format_util.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 80
81 gfx::GpuMemoryBufferId MojoGpuMemoryBufferImpl::GetId() const { 81 gfx::GpuMemoryBufferId MojoGpuMemoryBufferImpl::GetId() const {
82 return gfx::GpuMemoryBufferId(0); 82 return gfx::GpuMemoryBufferId(0);
83 } 83 }
84 84
85 gfx::GpuMemoryBufferHandle MojoGpuMemoryBufferImpl::GetHandle() const { 85 gfx::GpuMemoryBufferHandle MojoGpuMemoryBufferImpl::GetHandle() const {
86 gfx::GpuMemoryBufferHandle handle; 86 gfx::GpuMemoryBufferHandle handle;
87 handle.type = gfx::SHARED_MEMORY_BUFFER; 87 handle.type = gfx::SHARED_MEMORY_BUFFER;
88 handle.handle = shared_memory_->handle(); 88 handle.handle = shared_memory_->handle();
89 handle.offset = 0; 89 handle.offset = 0;
90 handle.stride = static_cast<int32_t>(
91 gfx::RowSizeForBufferFormat(size_.width(), format_, 0));
90 return handle; 92 return handle;
91 } 93 }
92 94
93 ClientBuffer MojoGpuMemoryBufferImpl::AsClientBuffer() { 95 ClientBuffer MojoGpuMemoryBufferImpl::AsClientBuffer() {
94 return reinterpret_cast<ClientBuffer>(this); 96 return reinterpret_cast<ClientBuffer>(this);
95 } 97 }
96 98
97 } // namespace mus 99 } // namespace mus
OLDNEW
« no previous file with comments | « components/mus/gles2/command_buffer_local.cc ('k') | content/browser/gpu/browser_gpu_memory_buffer_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698