Always explicitly allocate except in Android Framework (take 3)

This will turn on explicit allocation (w/o opList sorting) in Chrome. It leaves the old allocation system in place in Android Framework and some of Skia's older bots.

We want:
  Flutter and Chrome to always explicitly allocate but not sort opLists outside of DDLs
  Android to never explicitly allocate and, thus, automatically never sort opLists

This needs the following Chrome suppression CL to land first:
https://chromium-review.googlesource.com/c/chromium/src/+/15182 (Add flag to skia/config/SkUserConfig.h to unblock Skia roll)

TBR=bsalomon@google.com
Change-Id: I3f51005ebc975ec754c2e0d2c646c0c324b02158
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/200507
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/GrContext_Base.cpp b/src/gpu/GrContext_Base.cpp
index 7c45267..3d194a0 100644
--- a/src/gpu/GrContext_Base.cpp
+++ b/src/gpu/GrContext_Base.cpp
@@ -11,12 +11,6 @@
 #include "GrCaps.h"
 #include "GrSkSLFPFactoryCache.h"
 
-#ifdef SK_DISABLE_EXPLICIT_GPU_RESOURCE_ALLOCATION
-static const bool kDefaultExplicitlyAllocateGPUResources = false;
-#else
-static const bool kDefaultExplicitlyAllocateGPUResources = true;
-#endif
-
 static int32_t next_id() {
     static std::atomic<int32_t> nextID{1};
     int32_t id;
@@ -45,15 +39,11 @@
 }
 
 bool GrContext_Base::explicitlyAllocateGPUResources() const {
-    if (GrContextOptions::Enable::kNo == fOptions.fExplicitlyAllocateGPUResources) {
-        return false;
-    }
-
-    if (GrContextOptions::Enable::kYes == fOptions.fExplicitlyAllocateGPUResources) {
-        return true;
-    }
-
-    return kDefaultExplicitlyAllocateGPUResources;
+#ifdef SK_OLD_STYLE_RESOURCE_ALLOCATION
+    return false;
+#else
+    return true;
+#endif
 }
 
 const GrCaps* GrContext_Base::caps() const { return fCaps.get(); }
diff --git a/src/gpu/GrDDLContext.cpp b/src/gpu/GrDDLContext.cpp
index cfe81a1..6836e46 100644
--- a/src/gpu/GrDDLContext.cpp
+++ b/src/gpu/GrDDLContext.cpp
@@ -53,8 +53,7 @@
         }
 
         // DDL contexts/drawing managers always sort the oplists. This, in turn, implies that
-        // explicit resource allocation is always on (regardless of whatever the client specified
-        // in their context options).
+        // explicit resource allocation is always on (regardless of how Skia is compiled).
         this->setupDrawingManager(true, true);
 
         SkASSERT(this->caps());
diff --git a/src/gpu/GrLegacyDirectContext.cpp b/src/gpu/GrLegacyDirectContext.cpp
index 75fb6e1..d5bce1b 100644
--- a/src/gpu/GrLegacyDirectContext.cpp
+++ b/src/gpu/GrLegacyDirectContext.cpp
@@ -24,6 +24,12 @@
 #include "vk/GrVkGpu.h"
 #endif
 
+#ifdef SK_DISABLE_OPLIST_SORTING
+static const bool kDefaultSortOpLists = false;
+#else
+static const bool kDefaultSortOpLists = true;
+#endif
+
 class SK_API GrLegacyDirectContext : public GrContext {
 public:
     GrLegacyDirectContext(GrBackendApi backend, const GrContextOptions& options)
@@ -73,7 +79,7 @@
             return false;
         }
 
-        bool sortOpLists = this->explicitlyAllocateGPUResources();
+        bool sortOpLists = kDefaultSortOpLists;
         if (GrContextOptions::Enable::kNo == this->options().fSortRenderTargets) {
             sortOpLists = false;
         } else if (GrContextOptions::Enable::kYes == this->options().fSortRenderTargets) {