Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1432)

Unified Diff: cc/resources/texture_compressor.cc

Issue 1096703002: Reland: Add ETC1 powered SSE encoder for tile texture compression (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated comments, casts and other minor issues. Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: cc/resources/texture_compressor.cc
diff --git a/cc/resources/texture_compressor.cc b/cc/resources/texture_compressor.cc
index 186a47d04b65a7d9539b033a61b5c8d35c1d01f9..7a658b1556e0c8cf27679968aa43c146951dd647 100644
--- a/cc/resources/texture_compressor.cc
+++ b/cc/resources/texture_compressor.cc
@@ -7,12 +7,24 @@
#include "base/logging.h"
#include "cc/resources/texture_compressor_etc1.h"
+#ifdef __SSE2__
reveman 2015/05/07 16:26:29 #if defined(ARCH_CPU_X86_FAMILY), see comment belo
radu.velea 2015/05/08 10:52:10 Done.
+#include "base/cpu.h"
+#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__
reveman 2015/05/07 16:26:29 I found another example in the chromium code base
radu.velea 2015/05/08 10:52:11 Done.
+ base::CPU cpu;
+ if (cpu.has_sse2()) {
+ return make_scoped_ptr(new TextureCompressorETC1SSE());
+ }
+#endif
return make_scoped_ptr(new TextureCompressorETC1());
+ }
}
NOTREACHED();

Powered by Google App Engine
This is Rietveld 408576698