Index: cc/resources/texture_compressor.cc |
diff --git a/cc/resources/texture_compressor.cc b/cc/resources/texture_compressor.cc |
index 186a47d04b65a7d9539b033a61b5c8d35c1d01f9..673b447bd37e382df3dfc84c38f21a26efa9237a 100644 |
--- a/cc/resources/texture_compressor.cc |
+++ b/cc/resources/texture_compressor.cc |
@@ -4,19 +4,30 @@ |
#include "cc/resources/texture_compressor.h" |
+#include <stdio.h> |
reveman
2015/05/05 15:30:11
what is this for?
|
+ |
+#include "base/cpu.h" |
#include "base/logging.h" |
#include "cc/resources/texture_compressor_etc1.h" |
+#include "cc/resources/texture_compressor_etc1_sse.h" |
namespace cc { |
scoped_ptr<TextureCompressor> TextureCompressor::Create(Format format) { |
switch (format) { |
- case kFormatETC1: |
+ case kFormatETC1: { |
+#if defined(__i386__) || defined(__x86_x64__) |
reveman
2015/05/05 15:30:10
can we remove this ifdef an just rely on base::CPU
|
+ base::CPU cpu; |
+ if (cpu.has_sse2()) { |
+ return make_scoped_ptr(new TextureCompressorETC1SSE()); |
+ } |
+#endif |
return make_scoped_ptr(new TextureCompressorETC1()); |
+ } |
+ default: |
reveman
2015/05/05 15:30:11
please avoid having a default case so the compiler
|
+ NOTREACHED(); |
+ return nullptr; |
} |
- |
- NOTREACHED(); |
- return nullptr; |
} |
} // namespace cc |