Chromium Code Reviews| Index: cc/resources/texture_compressor.cc |
| diff --git a/cc/resources/texture_compressor.cc b/cc/resources/texture_compressor.cc |
| index 186a47d04b65a7d9539b033a61b5c8d35c1d01f9..231e509811000da92d9e1afac56b3350afb035d2 100644 |
| --- a/cc/resources/texture_compressor.cc |
| +++ b/cc/resources/texture_compressor.cc |
| @@ -4,15 +4,30 @@ |
| #include "cc/resources/texture_compressor.h" |
| +#ifdef __SSE2__ |
| +#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.
|
| +#endif |
| + |
| #include "base/logging.h" |
| #include "cc/resources/texture_compressor_etc1.h" |
| +#ifdef __SSE2__ |
| +#include "cc/resources/texture_compressor_etc1_sse.h" |
| +#endif |
| + |
| namespace cc { |
| scoped_ptr<TextureCompressor> TextureCompressor::Create(Format format) { |
| switch (format) { |
| - case kFormatETC1: |
| + case kFormatETC1: { |
| +#ifdef __SSE2__ |
| + base::CPU cpu; |
| + if (cpu.has_sse2()) { |
| + return make_scoped_ptr(new TextureCompressorETC1SSE()); |
| + } |
| +#endif |
| return make_scoped_ptr(new TextureCompressorETC1()); |
| + } |
| } |
| NOTREACHED(); |