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

Unified Diff: skia/ext/image_operations.cc

Issue 6334070: SIMD implementation of Convolver for Lanczos filter etc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: typo Created 9 years, 9 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
« no previous file with comments | « skia/ext/convolver_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: skia/ext/image_operations.cc
diff --git a/skia/ext/image_operations.cc b/skia/ext/image_operations.cc
index 51d2e4e252c26a690affc0a57232983df2228d72..a4af2d41b6b29106948ed52c6eeb10a02918a8ff 100644
--- a/skia/ext/image_operations.cc
+++ b/skia/ext/image_operations.cc
@@ -16,10 +16,10 @@
#include "base/time.h"
#include "build/build_config.h"
#include "skia/ext/convolver.h"
+#include "third_party/skia/include/core/SkColorPriv.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/core/SkRect.h"
#include "third_party/skia/include/core/SkFontHost.h"
-#include "third_party/skia/include/core/SkColorPriv.h"
namespace skia {
@@ -316,6 +316,8 @@ void ResizeFilter::ComputeFilters(int src_size,
output->AddFilter(src_begin, &fixed_filter_values[0],
static_cast<int>(fixed_filter_values->size()));
}
+
+ output->PaddingForSIMD(8);
}
ImageOperations::ResizeMethod ResizeMethodToAlgorithmMethod(
@@ -502,6 +504,7 @@ SkBitmap ImageOperations::ResizeBasic(const SkBitmap& source,
reinterpret_cast<const uint8*>(source.getPixels());
// Convolve into the result.
+ base::CPU cpu;
SkBitmap result;
result.setConfig(SkBitmap::kARGB_8888_Config,
dest_subset.width(), dest_subset.height());
@@ -509,7 +512,8 @@ SkBitmap ImageOperations::ResizeBasic(const SkBitmap& source,
BGRAConvolve2D(source_subset, static_cast<int>(source.rowBytes()),
!source.isOpaque(), filter.x_filter(), filter.y_filter(),
static_cast<int>(result.rowBytes()),
- static_cast<unsigned char*>(result.getPixels()));
+ static_cast<unsigned char*>(result.getPixels()),
+ cpu.has_sse2());
// Preserve the "opaque" flag for use as an optimization later.
result.setIsOpaque(source.isOpaque());
« no previous file with comments | « skia/ext/convolver_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698