OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/resources/texture_compressor.h" | 5 #include "cc/resources/texture_compressor.h" |
6 | 6 |
7 #include "base/cpu.h" | |
reveman
2015/05/06 18:44:00
nit: guard this with a ifdef as it's not always us
radu.velea
2015/05/07 11:21:39
Done.
| |
7 #include "base/logging.h" | 8 #include "base/logging.h" |
8 #include "cc/resources/texture_compressor_etc1.h" | 9 #include "cc/resources/texture_compressor_etc1.h" |
10 #include "cc/resources/texture_compressor_etc1_sse.h" | |
reveman
2015/05/06 18:44:00
nit: guard this with a ifdef as it's not always us
radu.velea
2015/05/07 11:21:39
Done.
| |
9 | 11 |
10 namespace cc { | 12 namespace cc { |
11 | 13 |
12 scoped_ptr<TextureCompressor> TextureCompressor::Create(Format format) { | 14 scoped_ptr<TextureCompressor> TextureCompressor::Create(Format format) { |
13 switch (format) { | 15 switch (format) { |
14 case kFormatETC1: | 16 case kFormatETC1: { |
17 #if defined(__i386__) || defined(__x86_64__) | |
reveman
2015/05/06 18:44:00
Can you add a define to the build files and use it
radu.velea
2015/05/07 11:21:39
-msse2 sets __SSE2__ would this be enough for the
| |
18 base::CPU cpu; | |
19 if (cpu.has_sse2()) { | |
20 return make_scoped_ptr(new TextureCompressorETC1SSE()); | |
21 } | |
22 #endif | |
15 return make_scoped_ptr(new TextureCompressorETC1()); | 23 return make_scoped_ptr(new TextureCompressorETC1()); |
24 } | |
16 } | 25 } |
17 | 26 |
18 NOTREACHED(); | 27 NOTREACHED(); |
19 return nullptr; | 28 return nullptr; |
20 } | 29 } |
21 | 30 |
22 } // namespace cc | 31 } // namespace cc |
OLD | NEW |