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

Side by Side Diff: cc/test/test_web_graphics_context_3d.cc

Issue 1539203002: Switch to standard integer types in cc/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more includes Created 4 years, 12 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
« no previous file with comments | « cc/test/test_web_graphics_context_3d.h ('k') | cc/tiles/eviction_tile_priority_queue.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "cc/test/test_web_graphics_context_3d.h" 5 #include "cc/test/test_web_graphics_context_3d.h"
6 6
7 #include <stddef.h>
8 #include <stdint.h>
9
7 #include <algorithm> 10 #include <algorithm>
8 #include <string> 11 #include <string>
9 12
10 #include "base/bind.h" 13 #include "base/bind.h"
11 #include "base/lazy_instance.h" 14 #include "base/lazy_instance.h"
12 #include "base/logging.h" 15 #include "base/logging.h"
13 #include "base/message_loop/message_loop.h" 16 #include "base/message_loop/message_loop.h"
14 #include "base/numerics/safe_conversions.h" 17 #include "base/numerics/safe_conversions.h"
15 #include "cc/test/test_context_support.h" 18 #include "cc/test/test_context_support.h"
16 #include "gpu/GLES2/gl2extchromium.h" 19 #include "gpu/GLES2/gl2extchromium.h"
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 DCHECK_GT(buffers.count(bound_buffer_), 0u); 544 DCHECK_GT(buffers.count(bound_buffer_), 0u);
542 DCHECK_EQ(target, buffers.get(bound_buffer_)->target); 545 DCHECK_EQ(target, buffers.get(bound_buffer_)->target);
543 Buffer* buffer = buffers.get(bound_buffer_); 546 Buffer* buffer = buffers.get(bound_buffer_);
544 if (context_lost_) { 547 if (context_lost_) {
545 buffer->pixels = nullptr; 548 buffer->pixels = nullptr;
546 return; 549 return;
547 } 550 }
548 551
549 size_t old_size = buffer->size; 552 size_t old_size = buffer->size;
550 553
551 buffer->pixels.reset(new uint8[size]); 554 buffer->pixels.reset(new uint8_t[size]);
552 buffer->size = size; 555 buffer->size = size;
553 if (data != NULL) 556 if (data != NULL)
554 memcpy(buffer->pixels.get(), data, size); 557 memcpy(buffer->pixels.get(), data, size);
555 if (buffer->target == GL_PIXEL_UNPACK_TRANSFER_BUFFER_CHROMIUM) 558 if (buffer->target == GL_PIXEL_UNPACK_TRANSFER_BUFFER_CHROMIUM)
556 current_used_transfer_buffer_usage_bytes_ += 559 current_used_transfer_buffer_usage_bytes_ +=
557 base::checked_cast<int>(buffer->size) - 560 base::checked_cast<int>(buffer->size) -
558 base::checked_cast<int>(old_size); 561 base::checked_cast<int>(old_size);
559 max_used_transfer_buffer_usage_bytes_ = 562 max_used_transfer_buffer_usage_bytes_ =
560 std::max(max_used_transfer_buffer_usage_bytes_, 563 std::max(max_used_transfer_buffer_usage_bytes_,
561 current_used_transfer_buffer_usage_bytes_); 564 current_used_transfer_buffer_usage_bytes_);
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
819 822
820 TestWebGraphicsContext3D::Buffer::Buffer() : target(0), size(0) {} 823 TestWebGraphicsContext3D::Buffer::Buffer() : target(0), size(0) {}
821 824
822 TestWebGraphicsContext3D::Buffer::~Buffer() {} 825 TestWebGraphicsContext3D::Buffer::~Buffer() {}
823 826
824 TestWebGraphicsContext3D::Image::Image() {} 827 TestWebGraphicsContext3D::Image::Image() {}
825 828
826 TestWebGraphicsContext3D::Image::~Image() {} 829 TestWebGraphicsContext3D::Image::~Image() {}
827 830
828 } // namespace cc 831 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/test_web_graphics_context_3d.h ('k') | cc/tiles/eviction_tile_priority_queue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698