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

Unified Diff: gpu/command_buffer/client/gles2_implementation.cc

Issue 2623223002: Ensure memory mapped chunk size is aligned with the FencedAllocator. (Closed)
Patch Set: Perform alignment in gles2_implementation.cc Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/client/gles2_implementation.cc
diff --git a/gpu/command_buffer/client/gles2_implementation.cc b/gpu/command_buffer/client/gles2_implementation.cc
index 75d616a9b2eb44f41dbaf75a8fb5077a4b72f307..7f49bd2f61f1d5e5c96eb4bcddb759db8d91fc6c 100644
--- a/gpu/command_buffer/client/gles2_implementation.cc
+++ b/gpu/command_buffer/client/gles2_implementation.cc
@@ -18,6 +18,7 @@
#include <sstream>
#include <string>
#include "base/atomic_sequence_num.h"
+#include "base/bits.h"
#include "base/compiler_specific.h"
#include "base/numerics/safe_math.h"
#include "base/strings/string_split.h"
@@ -219,6 +220,8 @@ bool GLES2Implementation::Initialize(
if (mapped_memory_limit != SharedMemoryLimits::kNoLimit) {
// Use smaller chunks if the client is very memory conscientious.
chunk_size = std::min(mapped_memory_limit / 4, chunk_size);
+ chunk_size = base::bits::Align(chunk_size,
+ FencedAllocator::kAllocAlignment);
}
mapped_memory_->set_chunk_size_multiple(chunk_size);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698