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: cc/test/test_web_graphics_context_3d.cc

Issue 609663003: cc: Remove use of PassAs() and constructor-casting with scoped_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cc-passas: PassAs-presubmit-warning Created 6 years, 2 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_shared_bitmap_manager.cc ('k') | cc/test/tiled_layer_test_common.cc » ('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 <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 void TestWebGraphicsContext3D::bufferData(GLenum target, 495 void TestWebGraphicsContext3D::bufferData(GLenum target,
496 GLsizeiptr size, 496 GLsizeiptr size,
497 const void* data, 497 const void* data,
498 GLenum usage) { 498 GLenum usage) {
499 base::AutoLock lock(namespace_->lock); 499 base::AutoLock lock(namespace_->lock);
500 base::ScopedPtrHashMap<unsigned, Buffer>& buffers = namespace_->buffers; 500 base::ScopedPtrHashMap<unsigned, Buffer>& buffers = namespace_->buffers;
501 DCHECK_GT(buffers.count(bound_buffer_), 0u); 501 DCHECK_GT(buffers.count(bound_buffer_), 0u);
502 DCHECK_EQ(target, buffers.get(bound_buffer_)->target); 502 DCHECK_EQ(target, buffers.get(bound_buffer_)->target);
503 Buffer* buffer = buffers.get(bound_buffer_); 503 Buffer* buffer = buffers.get(bound_buffer_);
504 if (context_lost_) { 504 if (context_lost_) {
505 buffer->pixels.reset(); 505 buffer->pixels = nullptr;
506 return; 506 return;
507 } 507 }
508 508
509 size_t old_size = buffer->size; 509 size_t old_size = buffer->size;
510 510
511 buffer->pixels.reset(new uint8[size]); 511 buffer->pixels.reset(new uint8[size]);
512 buffer->size = size; 512 buffer->size = size;
513 if (data != NULL) 513 if (data != NULL)
514 memcpy(buffer->pixels.get(), data, size); 514 memcpy(buffer->pixels.get(), data, size);
515 if (buffer->target == GL_PIXEL_UNPACK_TRANSFER_BUFFER_CHROMIUM) 515 if (buffer->target == GL_PIXEL_UNPACK_TRANSFER_BUFFER_CHROMIUM)
(...skipping 18 matching lines...) Expand all
534 534
535 return buffers.get(bound_buffer_)->pixels.get(); 535 return buffers.get(bound_buffer_)->pixels.get();
536 } 536 }
537 537
538 GLboolean TestWebGraphicsContext3D::unmapBufferCHROMIUM( 538 GLboolean TestWebGraphicsContext3D::unmapBufferCHROMIUM(
539 GLenum target) { 539 GLenum target) {
540 base::AutoLock lock(namespace_->lock); 540 base::AutoLock lock(namespace_->lock);
541 base::ScopedPtrHashMap<unsigned, Buffer>& buffers = namespace_->buffers; 541 base::ScopedPtrHashMap<unsigned, Buffer>& buffers = namespace_->buffers;
542 DCHECK_GT(buffers.count(bound_buffer_), 0u); 542 DCHECK_GT(buffers.count(bound_buffer_), 0u);
543 DCHECK_EQ(target, buffers.get(bound_buffer_)->target); 543 DCHECK_EQ(target, buffers.get(bound_buffer_)->target);
544 buffers.get(bound_buffer_)->pixels.reset(); 544 buffers.get(bound_buffer_)->pixels = nullptr;
545 return true; 545 return true;
546 } 546 }
547 547
548 GLuint TestWebGraphicsContext3D::createImageCHROMIUM(GLsizei width, 548 GLuint TestWebGraphicsContext3D::createImageCHROMIUM(GLsizei width,
549 GLsizei height, 549 GLsizei height,
550 GLenum internalformat, 550 GLenum internalformat,
551 GLenum usage) { 551 GLenum usage) {
552 DCHECK_EQ(GL_RGBA8_OES, static_cast<int>(internalformat)); 552 DCHECK_EQ(GL_RGBA8_OES, static_cast<int>(internalformat));
553 GLuint image_id = NextImageId(); 553 GLuint image_id = NextImageId();
554 base::AutoLock lock(namespace_->lock); 554 base::AutoLock lock(namespace_->lock);
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
726 726
727 TestWebGraphicsContext3D::Buffer::Buffer() : target(0), size(0) {} 727 TestWebGraphicsContext3D::Buffer::Buffer() : target(0), size(0) {}
728 728
729 TestWebGraphicsContext3D::Buffer::~Buffer() {} 729 TestWebGraphicsContext3D::Buffer::~Buffer() {}
730 730
731 TestWebGraphicsContext3D::Image::Image() {} 731 TestWebGraphicsContext3D::Image::Image() {}
732 732
733 TestWebGraphicsContext3D::Image::~Image() {} 733 TestWebGraphicsContext3D::Image::~Image() {}
734 734
735 } // namespace cc 735 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/test_shared_bitmap_manager.cc ('k') | cc/test/tiled_layer_test_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698