diff options
-rw-r--r-- | DEPS | 2 | ||||
-rw-r--r-- | include/core/SkChecksum.h | 6 | ||||
-rw-r--r-- | src/core/SkAdvancedTypefaceMetrics.cpp | 2 | ||||
-rw-r--r-- | src/core/SkEdge.cpp | 6 | ||||
-rw-r--r-- | src/core/SkEdge.h | 12 | ||||
-rw-r--r-- | src/core/SkGlyphCache.cpp | 2 | ||||
-rw-r--r-- | src/effects/gradients/SkGradientShader.cpp | 1 | ||||
-rw-r--r-- | src/gpu/gl/GrGpuGL.cpp | 11 | ||||
-rw-r--r-- | src/utils/SkDeferredCanvas.cpp | 2 | ||||
-rwxr-xr-x | tools/rebaseline.py | 15 |
10 files changed, 45 insertions, 14 deletions
@@ -12,6 +12,8 @@ deps = { "third_party/externals/gyp" : "http://gyp.googlecode.com/svn/trunk@1517", "third_party/externals/libjpeg" : "http://src.chromium.org/svn/trunk/src/third_party/libjpeg@125399", "third_party/externals/jsoncpp" : "http://src.chromium.org/svn/trunk/src/third_party/jsoncpp@125399", + "third_party/externals/jsoncpp/source/include" : "http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/include@248", + "third_party/externals/jsoncpp/source/src/lib_json" : "http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@248", } #hooks = [ diff --git a/include/core/SkChecksum.h b/include/core/SkChecksum.h index e5cc3d101f..9cb45c3307 100644 --- a/include/core/SkChecksum.h +++ b/include/core/SkChecksum.h @@ -30,6 +30,11 @@ public: /** * Compute a 32-bit checksum for a given data block * + * WARNING: this algorithm is tuned for efficiency, not backward/forward + * compatibility. It may change at any time, so a checksum generated with + * one version of the Skia code may not match a checksum generated with + * a different version of the Skia code. + * * @param data Memory address of the data block to be processed. Must be * 32-bit aligned. * @param size Size of the data block in bytes. Must be a multiple of 4. @@ -83,4 +88,3 @@ public: }; #endif - diff --git a/src/core/SkAdvancedTypefaceMetrics.cpp b/src/core/SkAdvancedTypefaceMetrics.cpp index 370616ef95..b647ada260 100644 --- a/src/core/SkAdvancedTypefaceMetrics.cpp +++ b/src/core/SkAdvancedTypefaceMetrics.cpp @@ -13,7 +13,7 @@ SK_DEFINE_INST_COUNT(SkAdvancedTypefaceMetrics) #if defined(SK_BUILD_FOR_WIN) -#include <DWrite.h> +#include <dwrite.h> #endif #if defined(SK_BUILD_FOR_UNIX) || defined(SK_BUILD_FOR_ANDROID) diff --git a/src/core/SkEdge.cpp b/src/core/SkEdge.cpp index fff3dbcc6a..e646c4765f 100644 --- a/src/core/SkEdge.cpp +++ b/src/core/SkEdge.cpp @@ -72,8 +72,9 @@ int SkEdge::setLine(const SkPoint& p0, const SkPoint& p1, const SkIRect* clip, } SkFixed slope = SkFDot6Div(x1 - x0, y1 - y0); + const int dy = SkEdge_Compute_DY(top, y0); - fX = SkFDot6ToFixed(x0 + SkFixedMul(slope, (32 - y0) & 63)); // + SK_Fixed1/2 + fX = SkFDot6ToFixed(x0 + SkFixedMul(slope, dy)); // + SK_Fixed1/2 fDX = slope; fFirstY = top; fLastY = bot - 1; @@ -112,8 +113,9 @@ int SkEdge::updateLine(SkFixed x0, SkFixed y0, SkFixed x1, SkFixed y1) x1 >>= 10; SkFixed slope = SkFDot6Div(x1 - x0, y1 - y0); + const int dy = SkEdge_Compute_DY(top, y0); - fX = SkFDot6ToFixed(x0 + SkFixedMul(slope, (32 - y0) & 63)); // + SK_Fixed1/2 + fX = SkFDot6ToFixed(x0 + SkFixedMul(slope, dy)); // + SK_Fixed1/2 fDX = slope; fFirstY = top; fLastY = bot - 1; diff --git a/src/core/SkEdge.h b/src/core/SkEdge.h index 53678621c3..c36ba246ce 100644 --- a/src/core/SkEdge.h +++ b/src/core/SkEdge.h @@ -14,6 +14,15 @@ #include "SkFDot6.h" #include "SkMath.h" +//#ifdef SK_IGNORE_SETLINE_FIX +#if 1 + #define SkEdge_Compute_DY(top, y0) ((32 - (y0)) & 63) +#else + // This is correct, as it favors the lower-pixel when y0 is on a 1/2 pixel + // boundary, returning 64 instead of the old code, which returns 0. + #define SkEdge_Compute_DY(top, y0) ((top << 6) + 32 - (y0)) +#endif + struct SkEdge { enum Type { kLine_Type, @@ -118,8 +127,9 @@ int SkEdge::setLine(const SkPoint& p0, const SkPoint& p1, int shift) { } SkFixed slope = SkFDot6Div(x1 - x0, y1 - y0); + const int dy = SkEdge_Compute_DY(top, y0); - fX = SkFDot6ToFixed(x0 + SkFixedMul(slope, (32 - y0) & 63)); // + SK_Fixed1/2 + fX = SkFDot6ToFixed(x0 + SkFixedMul(slope, dy)); // + SK_Fixed1/2 fDX = slope; fFirstY = top; fLastY = bot - 1; diff --git a/src/core/SkGlyphCache.cpp b/src/core/SkGlyphCache.cpp index 5904edd3c0..ae213e94b5 100644 --- a/src/core/SkGlyphCache.cpp +++ b/src/core/SkGlyphCache.cpp @@ -599,7 +599,7 @@ void SkGlyphCache::AttachCache(SkGlyphCache* cache) { // if we have a fixed budget for our cache, do a purge here { size_t allocated = globals.fTotalMemoryUsed + cache->fMemoryUsed; - size_t budgeted = SkGraphics::GetFontCacheLimit(); + size_t budgeted = globals.getFontCacheLimit(); if (allocated > budgeted) { (void)InternalFreeCache(&globals, allocated - budgeted); } diff --git a/src/effects/gradients/SkGradientShader.cpp b/src/effects/gradients/SkGradientShader.cpp index d71195c623..60eff91d65 100644 --- a/src/effects/gradients/SkGradientShader.cpp +++ b/src/effects/gradients/SkGradientShader.cpp @@ -705,7 +705,6 @@ void GrGLGradientEffect::emitColorLookup(GrGLShaderBuilder* builder, code->appendf("\tvec2 coord = vec2(%s, %s);\n", gradientTValue, builder->getUniformVariable(fFSYUni).c_str()); - GrGLSLMulVarBy4f(code, 1, outputColor, inputColor); code->appendf("\t%s = ", outputColor); builder->appendTextureLookupAndModulate(code, inputColor, sampler, "coord"); code->append(";\n"); diff --git a/src/gpu/gl/GrGpuGL.cpp b/src/gpu/gl/GrGpuGL.cpp index 28963f1ab1..eb60539fbf 100644 --- a/src/gpu/gl/GrGpuGL.cpp +++ b/src/gpu/gl/GrGpuGL.cpp @@ -477,11 +477,20 @@ void GrGpuGL::onResetContext() { } GrTexture* GrGpuGL::onWrapBackendTexture(const GrBackendTextureDesc& desc) { - GrGLTexture::Desc glTexDesc; if (!this->configToGLFormats(desc.fConfig, false, NULL, NULL, NULL)) { return NULL; } + if (0 == desc.fTextureHandle) { + return NULL; + } + + int maxSize = this->getCaps().maxTextureSize(); + if (desc.fWidth > maxSize || desc.fHeight > maxSize) { + return NULL; + } + + GrGLTexture::Desc glTexDesc; // next line relies on GrBackendTextureDesc's flags matching GrTexture's glTexDesc.fFlags = (GrTextureFlags) desc.fFlags; glTexDesc.fWidth = desc.fWidth; diff --git a/src/utils/SkDeferredCanvas.cpp b/src/utils/SkDeferredCanvas.cpp index 13b8d282c6..207ec053a7 100644 --- a/src/utils/SkDeferredCanvas.cpp +++ b/src/utils/SkDeferredCanvas.cpp @@ -406,7 +406,7 @@ void DeferredDevice::flushPendingCommands(PlaybackMode playbackMode) { fNotificationClient->prepareForDraw(); } fPipeWriter.flushRecording(true); - fPipeController.playback(playbackMode); + fPipeController.playback(kSilent_PlaybackMode == playbackMode); if (playbackMode == kNormal_PlaybackMode && fNotificationClient) { fNotificationClient->flushedDrawCommands(); } diff --git a/tools/rebaseline.py b/tools/rebaseline.py index f069108110..58eeb1d5d6 100755 --- a/tools/rebaseline.py +++ b/tools/rebaseline.py @@ -17,10 +17,10 @@ import os, subprocess, sys, tempfile pairs = [ ['base-shuttle-win7-intel-float', 'Skia_Shuttle_Win7_Intel_Float_Release_32'], -# ['base-shuttle-win7-intel-angle', -# 'Skia_Shuttle_Win7_Intel_Float_ANGLE_Release_32'], -# ['base-shuttle-win7-intel-directwrite', -# 'Skia_Shuttle_Win7_Intel_Float_DirectWrite_Release_32'], + ['base-shuttle-win7-intel-angle', + 'Skia_Shuttle_Win7_Intel_Float_ANGLE_Release_32'], + ['base-shuttle-win7-intel-directwrite', + 'Skia_Shuttle_Win7_Intel_Float_DirectWrite_Release_32'], ['base-shuttle_ubuntu12_ati5770', 'Skia_Shuttle_Ubuntu12_ATI5770_Float_Release_64'], ['base-macmini', @@ -42,9 +42,12 @@ if len(sys.argv) != 2: exit(1) testname = sys.argv[1] -testtypes = [ '4444', '565', '8888', 'gpu', 'pdf' ] for pair in pairs: + if (pair[0] == 'base-shuttle-win7-intel-angle'): + testtypes = [ 'angle' ] + else: + testtypes = [ '4444', '565', '8888', 'gpu', 'pdf' ] print pair[0] + ':' for testtype in testtypes: infilename = testname + '_' + testtype + '.png' @@ -62,3 +65,5 @@ for pair in pairs: subprocess.call(cmd); cmd = [ 'svn', 'add', '--quiet', outfilename ] subprocess.call(cmd) + cmd = [ 'svn', 'propset', '--quiet', 'svn:mime-type', 'image/png', outfilename ]; + subprocess.call(cmd) |