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

Side by Side Diff: cc/scheduler/texture_uploader_unittest.cc

Issue 147603006: [#7] Resubmitted - Pass gfx structs by const ref (gfx::Size) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Resubmit 145313006 Created 6 years, 10 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/scheduler/texture_uploader.cc ('k') | cc/test/fake_picture_layer_impl.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 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
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
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
OLDNEW
« no previous file with comments | « cc/scheduler/texture_uploader.cc ('k') | cc/test/fake_picture_layer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698