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 #ifdef __SSE2__ | |
8 #include "base/cpu.h" | |
reveman
2015/05/07 14:24:35
nit: you can move this into the ifdef below
radu.velea
2015/05/07 15:53:45
Done.
| |
9 #endif | |
10 | |
7 #include "base/logging.h" | 11 #include "base/logging.h" |
8 #include "cc/resources/texture_compressor_etc1.h" | 12 #include "cc/resources/texture_compressor_etc1.h" |
9 | 13 |
14 #ifdef __SSE2__ | |
15 #include "cc/resources/texture_compressor_etc1_sse.h" | |
16 #endif | |
17 | |
10 namespace cc { | 18 namespace cc { |
11 | 19 |
12 scoped_ptr<TextureCompressor> TextureCompressor::Create(Format format) { | 20 scoped_ptr<TextureCompressor> TextureCompressor::Create(Format format) { |
13 switch (format) { | 21 switch (format) { |
14 case kFormatETC1: | 22 case kFormatETC1: { |
23 #ifdef __SSE2__ | |
24 base::CPU cpu; | |
25 if (cpu.has_sse2()) { | |
26 return make_scoped_ptr(new TextureCompressorETC1SSE()); | |
27 } | |
28 #endif | |
15 return make_scoped_ptr(new TextureCompressorETC1()); | 29 return make_scoped_ptr(new TextureCompressorETC1()); |
30 } | |
16 } | 31 } |
17 | 32 |
18 NOTREACHED(); | 33 NOTREACHED(); |
19 return nullptr; | 34 return nullptr; |
20 } | 35 } |
21 | 36 |
22 } // namespace cc | 37 } // namespace cc |
OLD | NEW |