OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <stdio.h> | 5 #include <stdio.h> |
6 #include <cmath> | 6 #include <cmath> |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include <GLES2/gl2.h> | 10 #include <GLES2/gl2.h> |
(...skipping 983 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
994 gfx::Rect(src_size), | 994 gfx::Rect(src_size), |
995 pixels, | 995 pixels, |
996 bitmap_config); | 996 bitmap_config); |
997 } | 997 } |
998 } | 998 } |
999 | 999 |
1000 // Test basic format readback. | 1000 // Test basic format readback. |
1001 bool TestTextureFormatReadback(const gfx::Size& src_size, | 1001 bool TestTextureFormatReadback(const gfx::Size& src_size, |
1002 SkBitmap::Config bitmap_config, | 1002 SkBitmap::Config bitmap_config, |
1003 bool async) { | 1003 bool async) { |
1004 DCHECK((bitmap_config == SkBitmap::kRGB_565_Config) || | 1004 if (!helper_->IsReadBackConfigSupported(bitmap_config)) { |
1005 (bitmap_config == SkBitmap::kARGB_8888_Config)); | 1005 LOG(INFO) << "Format Not supported on this platform" << bitmap_config |
1006 bool rgb565_format = (bitmap_config == SkBitmap::kRGB_565_Config); | 1006 << "Skipping the test"; |
no sievers
2014/02/19 19:09:39
nit: does this need to be spaced? something like
sivag
2014/02/21 11:40:51
Done.
| |
1007 if (rgb565_format && !helper_->CanUseRgb565Readback()) { | |
1008 LOG(INFO) << "RGB565 Format Not supported on this platform"; | |
1009 LOG(INFO) << "Skipping RGB565ReadBackTest"; | |
1010 return true; | 1007 return true; |
1011 } | 1008 } |
1012 WebGLId src_texture = context_->createTexture(); | 1009 WebGLId src_texture = context_->createTexture(); |
1013 SkBitmap input_pixels; | 1010 SkBitmap input_pixels; |
1014 input_pixels.setConfig(bitmap_config, src_size.width(), | 1011 input_pixels.setConfig(bitmap_config, src_size.width(), |
1015 src_size.height()); | 1012 src_size.height()); |
1016 input_pixels.allocPixels(); | 1013 input_pixels.allocPixels(); |
1017 SkAutoLockPixels lock1(input_pixels); | 1014 SkAutoLockPixels lock1(input_pixels); |
1018 // Test Pattern-1, Fill with Plain color pattern. | 1015 // Test Pattern-1, Fill with Plain color pattern. |
1019 // Erase the input bitmap with red color. | 1016 // Erase the input bitmap with red color. |
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1670 #endif | 1667 #endif |
1671 #if defined(TOOLKIT_GTK) | 1668 #if defined(TOOLKIT_GTK) |
1672 gfx::GtkInitFromCommandLine(*CommandLine::ForCurrentProcess()); | 1669 gfx::GtkInitFromCommandLine(*CommandLine::ForCurrentProcess()); |
1673 #endif | 1670 #endif |
1674 gpu::ApplyGpuDriverBugWorkarounds(CommandLine::ForCurrentProcess()); | 1671 gpu::ApplyGpuDriverBugWorkarounds(CommandLine::ForCurrentProcess()); |
1675 | 1672 |
1676 content::UnitTestTestSuite runner(suite); | 1673 content::UnitTestTestSuite runner(suite); |
1677 base::MessageLoop message_loop; | 1674 base::MessageLoop message_loop; |
1678 return runner.Run(); | 1675 return runner.Run(); |
1679 } | 1676 } |
OLD | NEW |