| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium OS 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 <stdio.h> | 5 #include <stdio.h> |
| 6 | 6 |
| 7 #include "main.h" | 7 #include "main.h" |
| 8 #include "testbase.h" | 8 #include "testbase.h" |
| 9 #include "utils.h" | 9 #include "utils.h" |
| 10 | 10 |
| 11 | 11 |
| 12 namespace glbench { | 12 namespace glbench { |
| 13 | 13 |
| 14 const float kScreenScaleFactor = 1e6f * (WINDOW_WIDTH * WINDOW_HEIGHT) / | 14 const float kScreenScaleFactor = 1e6f * (WINDOW_WIDTH * WINDOW_HEIGHT) / |
| 15 (1280.f * 768); | 15 (1280.f * 768); |
| 16 | 16 |
| 17 class WindowManagerCompositingTest : public TestBase { | 17 class WindowManagerCompositingTest : public TestBase { |
| 18 public: | 18 public: |
| 19 WindowManagerCompositingTest(bool scissor) | 19 WindowManagerCompositingTest(bool scissor) |
| 20 : scissor_(scissor), | 20 : scissor_(scissor), |
| 21 compositing_background_program_(0), | 21 compositing_background_program_(0), |
| 22 compositing_foreground_program_(0) {} | 22 compositing_foreground_program_(0) {} |
| 23 virtual ~WindowManagerCompositingTest() {} | 23 virtual ~WindowManagerCompositingTest() {} |
| 24 virtual bool TestFunc(int iter); | 24 virtual bool TestFunc(int iter); |
| 25 virtual bool Run(); | 25 virtual bool Run(); |
| 26 virtual const char* Name() const { return "compositing"; } |
| 26 | 27 |
| 27 void InitializeCompositing(); | 28 void InitializeCompositing(); |
| 28 void TeardownCompositing(); | 29 void TeardownCompositing(); |
| 29 void InitBaseTexture(); | 30 void InitBaseTexture(); |
| 30 void UpdateTexture(); | 31 void UpdateTexture(); |
| 31 void LoadTexture(); | 32 void LoadTexture(); |
| 32 | 33 |
| 33 private: | 34 private: |
| 34 bool scissor_; | 35 bool scissor_; |
| 35 uint32_t texture_base_[WINDOW_HEIGHT*WINDOW_WIDTH]; | 36 uint32_t texture_base_[WINDOW_HEIGHT*WINDOW_WIDTH]; |
| (...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 } | 410 } |
| 410 | 411 |
| 411 void WindowManagerCompositingTest::LoadTexture() { | 412 void WindowManagerCompositingTest::LoadTexture() { |
| 412 // Use GL_RGBA for compatibility with GLES2.0. | 413 // Use GL_RGBA for compatibility with GLES2.0. |
| 413 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, | 414 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, |
| 414 WINDOW_WIDTH, WINDOW_HEIGHT, 0, | 415 WINDOW_WIDTH, WINDOW_HEIGHT, 0, |
| 415 GL_RGBA, GL_UNSIGNED_BYTE, texture_update_); | 416 GL_RGBA, GL_UNSIGNED_BYTE, texture_update_); |
| 416 } | 417 } |
| 417 | 418 |
| 418 } // namespace glbench | 419 } // namespace glbench |
| OLD | NEW |