OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #include "cc/scheduler/texture_uploader.h" | 5 #include "cc/scheduler/texture_uploader.h" |
6 | 6 |
7 #include "cc/base/util.h" | 7 #include "cc/base/util.h" |
8 #include "cc/resources/prioritized_resource.h" | 8 #include "cc/resources/prioritized_resource.h" |
9 #include "gpu/command_buffer/client/gles2_interface_stub.h" | 9 #include "gpu/command_buffer/client/gles2_interface_stub.h" |
10 #include "testing/gmock/include/gmock/gmock.h" | 10 #include "testing/gmock/include/gmock/gmock.h" |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 | 138 |
139 private: | 139 private: |
140 unsigned result_available_; | 140 unsigned result_available_; |
141 unsigned unpack_alignment_; | 141 unsigned unpack_alignment_; |
142 | 142 |
143 DISALLOW_COPY_AND_ASSIGN(TextureUploadTestContext); | 143 DISALLOW_COPY_AND_ASSIGN(TextureUploadTestContext); |
144 }; | 144 }; |
145 | 145 |
146 void UploadTexture(TextureUploader* uploader, | 146 void UploadTexture(TextureUploader* uploader, |
147 ResourceFormat format, | 147 ResourceFormat format, |
148 gfx::Size size, | 148 const gfx::Size& size, |
149 const uint8* data) { | 149 const uint8* data) { |
150 uploader->Upload(data, | 150 uploader->Upload(data, |
151 gfx::Rect(size), | 151 gfx::Rect(size), |
152 gfx::Rect(size), | 152 gfx::Rect(size), |
153 gfx::Vector2d(), | 153 gfx::Vector2d(), |
154 format, | 154 format, |
155 size); | 155 size); |
156 } | 156 } |
157 | 157 |
158 TEST(TextureUploaderTest, NumBlockingUploads) { | 158 TEST(TextureUploaderTest, NumBlockingUploads) { |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 for (int i = 0; i < 86; ++i) { | 226 for (int i = 0; i < 86; ++i) { |
227 // Mark the beginning and end of each row, for the test. | 227 // Mark the beginning and end of each row, for the test. |
228 buffer[i * 1 * 82] = 0x1; | 228 buffer[i * 1 * 82] = 0x1; |
229 buffer[(i + 1) * 82 - 1] = 0x2; | 229 buffer[(i + 1) * 82 - 1] = 0x2; |
230 } | 230 } |
231 UploadTexture(uploader.get(), LUMINANCE_8, gfx::Size(82, 86), buffer); | 231 UploadTexture(uploader.get(), LUMINANCE_8, gfx::Size(82, 86), buffer); |
232 } | 232 } |
233 | 233 |
234 } // namespace | 234 } // namespace |
235 } // namespace cc | 235 } // namespace cc |
OLD | NEW |