Revert of Enable RAW codec for Windows (patchset #8 id:140001 of https://codereview...
authormtklein <mtklein@google.com>
Sat, 27 Feb 2016 00:57:33 +0000 (16:57 -0800)
committerCommit bot <commit-bot@chromium.org>
Sat, 27 Feb 2016 00:57:33 +0000 (16:57 -0800)
Reason for revert:
I don't think there's anything wrong with this per-se, but the 32-bit Windows bots are running out of memory while running these tests now.

(You'll see something like c:\0\build\slave\workdir\build\skia\include\core\skbitmap.h:247: fatal error: ""sk_throw"" in the log.)

We run these tests in parallel, and sometimes these 32-bit processes try to use more than the 2-3G RAM they can allocate.  Seems like this is a particularly memory-intense process?

If we reland this, we might want to blacklist these tests on the 32-bit Windows bots.  The 64-bit bots should have access to tons and tons of RAM and let us keep testing for Windows.

Original issue's description:
> Enable RAW codec for Windows
>
> * Fix the exception catching
> * Set preprocessor differently for MSVC
>
> BUG=skia:4889(b/26958348)
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1738913002
>
> Committed: https://skia.googlesource.com/skia/+/474e4c3dd28b67f590851321f15d9983ef7fd031

TBR=scroggo@google.com,msarett@google.com,yujieqin@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:4889(b/26958348)

Review URL: https://codereview.chromium.org/1747443003

gyp/common_variables.gypi
gyp/dng_sdk.gyp
src/codec/SkRawCodec.cpp

index e26939f..0688f62 100644 (file)
         'skia_os%': '<(skia_os)',
         'vulkan_merged_into_skia': '1',
         'skia_android_framework%': 0,
-        # RAW codec needs exceptions. Due to that, it is a separate target. Its usage can be
-        # controlled by skia_codec_decodes_raw.
-        'skia_codec_decodes_raw%': 1,
         'conditions' : [
           [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris", "mac"]', {
             'skia_arch_type%': 'x86_64',
           }, {
             'skia_arch_type%': 'x86',
           }],
+          # RAW codec needs exceptions. Due to that, it is a separate target. Its usage can be
+          # controlled by skia_codec_decodes_raw.
+          ['skia_os == "win"', {
+            'skia_codec_decodes_raw%' : 0,
+          }, {
+            'skia_codec_decodes_raw%' : 1,
+          }],
         ],
         'arm_version%': 0,
         'arm_neon%': 0,
index 3d42624..7655fd3 100644 (file)
       'msvs_settings': {
         'VCCLCompilerTool': {
           'WarningLevel': '0',
-          'AdditionalOptions': [
-            '/wd4189',
-            '/DqDNGBigEndian#0',
-            '/DqDNGReportErrors#0',
-            '/DqDNGThreadSafe#1',
-            '/DqDNGUseLibJPEG#1',
-            '/DqDNGUseXMP#0',
-            '/DqDNGValidate#0',
-            '/DqDNGValidateTarget#1',
-          ],
+          'AdditionalOptions': ['/wd4189', ],
         },
       },
     }],
index 9d0fb1c..a006e50 100644 (file)
 #include "SkColorPriv.h"
 #include "SkData.h"
 #include "SkJpegCodec.h"
-#include "SkMutex.h"
 #include "SkRawCodec.h"
 #include "SkRefCnt.h"
 #include "SkStream.h"
 #include "SkStreamPriv.h"
 #include "SkSwizzler.h"
-#include "SkTArray.h"
 #include "SkTaskGroup.h"
 #include "SkTemplates.h"
 #include "SkTypes.h"
 
 #include "dng_area_task.h"
 #include "dng_color_space.h"
-#include "dng_errors.h"
 #include "dng_exceptions.h"
 #include "dng_host.h"
 #include "dng_info.h"
@@ -108,30 +105,15 @@ public:
         const std::vector<dng_rect> taskAreas = compute_task_areas(maxTasks, area, tileSize);
         const int numTasks = static_cast<int>(taskAreas.size());
 
-        SkMutex mutex;
-        SkTArray<dng_exception> exceptions;
         task.Start(numTasks, tileSize, &Allocator(), Sniffer());
         for (int taskIndex = 0; taskIndex < numTasks; ++taskIndex) {
-            taskGroup.add([&mutex, &exceptions, &task, this, taskIndex, taskAreas, tileSize] {
-                try {
-                    task.ProcessOnThread(taskIndex, taskAreas[taskIndex], tileSize, this->Sniffer());
-                } catch (dng_exception& exception) {
-                    SkAutoMutexAcquire lock(mutex);
-                    exceptions.push_back(exception);
-                } catch (...) {
-                    SkAutoMutexAcquire lock(mutex);
-                    exceptions.push_back(dng_exception(dng_error_unknown));
-                }
+            taskGroup.add([&task, this, taskIndex, taskAreas, tileSize] {
+                task.ProcessOnThread(taskIndex, taskAreas[taskIndex], tileSize, this->Sniffer());
             });
         }
 
         taskGroup.wait();
         task.Finish(numTasks);
-
-        // Currently we only re-throw the first catched exception.
-        if (!exceptions.empty()) {
-            Throw_dng_error(exceptions.front().ErrorCode(), nullptr, nullptr);
-        }
     }
 
     uint32 PerformAreaTaskThreads() override {
@@ -446,15 +428,15 @@ public:
             }
         }
 
+        // render() takes ownership of fHost, fInfo, fNegative and fDngStream when available.
+        SkAutoTDelete<dng_host> host(fHost.release());
+        SkAutoTDelete<dng_info> info(fInfo.release());
+        SkAutoTDelete<dng_negative> negative(fNegative.release());
+        SkAutoTDelete<dng_stream> dngStream(fDngStream.release());
+
         // DNG SDK preserves the aspect ratio, so it only needs to know the longer dimension.
         const int preferredSize = SkTMax(width, height);
         try {
-            // render() takes ownership of fHost, fInfo, fNegative and fDngStream when available.
-            SkAutoTDelete<dng_host> host(fHost.release());
-            SkAutoTDelete<dng_info> info(fInfo.release());
-            SkAutoTDelete<dng_negative> negative(fNegative.release());
-            SkAutoTDelete<dng_stream> dngStream(fDngStream.release());
-
             host->SetPreferredSize(preferredSize);
             host->ValidateSizes();
 
@@ -524,12 +506,11 @@ private:
     }
 
     bool readDng() {
+        // Due to the limit of DNG SDK, we need to reset host and info.
+        fHost.reset(new SkDngHost(&fAllocator));
+        fInfo.reset(new dng_info);
+        fDngStream.reset(new SkDngStream(fStream));
         try {
-            // Due to the limit of DNG SDK, we need to reset host and info.
-            fHost.reset(new SkDngHost(&fAllocator));
-            fInfo.reset(new dng_info);
-            fDngStream.reset(new SkDngStream(fStream));
-
             fHost->ValidateSizes();
             fInfo->Parse(*fHost, *fDngStream);
             fInfo->PostParse(*fHost);