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

Side by Side Diff: gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h

Issue 10834248: Clean-up inline members of nested classes (gpu/) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: GLES2_IMPL_EXPORT Created 8 years, 4 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_BASE_H_ 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_BASE_H_
6 #define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_BASE_H_ 6 #define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_BASE_H_
7 7
8 #include "gpu/command_buffer/common/gl_mock.h" 8 #include "gpu/command_buffer/common/gl_mock.h"
9 #include "gpu/command_buffer/common/gles2_cmd_format.h" 9 #include "gpu/command_buffer/common/gles2_cmd_format.h"
10 #include "gpu/command_buffer/common/gles2_cmd_utils.h" 10 #include "gpu/command_buffer/common/gles2_cmd_utils.h"
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 uint32 shared_memory_id_; 464 uint32 shared_memory_id_;
465 uint32 shared_memory_offset_; 465 uint32 shared_memory_offset_;
466 void* shared_memory_address_; 466 void* shared_memory_address_;
467 void* shared_memory_base_; 467 void* shared_memory_base_;
468 468
469 int8 immediate_buffer_[256]; 469 int8 immediate_buffer_[256];
470 470
471 private: 471 private:
472 class MockCommandBufferEngine : public CommandBufferEngine { 472 class MockCommandBufferEngine : public CommandBufferEngine {
473 public: 473 public:
474 MockCommandBufferEngine() { 474 MockCommandBufferEngine();
475 data_.reset(new int8[kSharedBufferSize]);
476 ClearSharedMemory();
477 valid_buffer_.ptr = data_.get();
478 valid_buffer_.size = kSharedBufferSize;
479 }
480 475
481 virtual ~MockCommandBufferEngine() { 476 virtual ~MockCommandBufferEngine();
482 }
483 477
484 virtual Buffer GetSharedMemoryBuffer(int32 shm_id) OVERRIDE { 478 virtual Buffer GetSharedMemoryBuffer(int32 shm_id) OVERRIDE;
485 return shm_id == kSharedMemoryId ? valid_buffer_ : invalid_buffer_;
486 }
487 479
488 void ClearSharedMemory() { 480 void ClearSharedMemory() {
489 memset(data_.get(), kInitialMemoryValue, kSharedBufferSize); 481 memset(data_.get(), kInitialMemoryValue, kSharedBufferSize);
490 } 482 }
491 483
492 virtual void set_token(int32 token) OVERRIDE { 484 virtual void set_token(int32 token) OVERRIDE;
493 DCHECK(false);
494 }
495 485
496 virtual bool SetGetBuffer(int32 /* transfer_buffer_id */) OVERRIDE { 486 virtual bool SetGetBuffer(int32 /* transfer_buffer_id */) OVERRIDE;
497 DCHECK(false);
498 return false;
499 }
500 487
501 // Overridden from CommandBufferEngine. 488 // Overridden from CommandBufferEngine.
502 virtual bool SetGetOffset(int32 offset) OVERRIDE { 489 virtual bool SetGetOffset(int32 offset) OVERRIDE;
503 DCHECK(false);
504 return false;
505 }
506 490
507 // Overridden from CommandBufferEngine. 491 // Overridden from CommandBufferEngine.
508 virtual int32 GetGetOffset() OVERRIDE { 492 virtual int32 GetGetOffset() OVERRIDE;
509 DCHECK(false);
510 return 0;
511 }
512 493
513 private: 494 private:
514 scoped_array<int8> data_; 495 scoped_array<int8> data_;
515 Buffer valid_buffer_; 496 Buffer valid_buffer_;
516 Buffer invalid_buffer_; 497 Buffer invalid_buffer_;
517 }; 498 };
518 499
519 void AddExpectationsForVertexAttribManager(); 500 void AddExpectationsForVertexAttribManager();
520 501
521 scoped_ptr< ::testing::StrictMock<MockCommandBufferEngine> > engine_; 502 scoped_ptr< ::testing::StrictMock<MockCommandBufferEngine> > engine_;
522 ContextGroup::Ref group_; 503 ContextGroup::Ref group_;
523 }; 504 };
524 505
525 class GLES2DecoderWithShaderTestBase : public GLES2DecoderTestBase { 506 class GLES2DecoderWithShaderTestBase : public GLES2DecoderTestBase {
526 public: 507 public:
527 GLES2DecoderWithShaderTestBase() 508 GLES2DecoderWithShaderTestBase()
528 : GLES2DecoderTestBase() { 509 : GLES2DecoderTestBase() {
529 } 510 }
530 511
531 protected: 512 protected:
532 virtual void SetUp() OVERRIDE; 513 virtual void SetUp() OVERRIDE;
533 virtual void TearDown() OVERRIDE; 514 virtual void TearDown() OVERRIDE;
534 515
535 }; 516 };
536 517
537 } // namespace gles2 518 } // namespace gles2
538 } // namespace gpu 519 } // namespace gpu
539 520
540 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_BASE_H_ 521 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_BASE_H_
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/feature_info.cc ('k') | gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698