[go: nahoru, domu]

Use new GrDirectContext factories instead of deprecated GrContext ones

GrContext is going away (to be replaced with a GrDirectContext/
GrRecordingContext pair). This transitions Chromium over to using
the GrDirectContext factories to create the direct contexts it uses.

Skia's GrContext, in the past, was a catch-all location that stored
information for Skia's GPU backend (e.g., resource caches) and provided
services that required access to the GPU (e.g., creation of backend
textures, flushing, etc.). In the new world, most of these capabilities
are being moved to the GrDirectContext - which has _direct_ access
to the GPU. The GrRecordingContext is a weaker context that lacks
access to the GPU and thus can't provide some of the services of the
old GrContext. The GrRecordingContext gains relevance when DDL
recording. In that mode, both clients and Skia's GPU backend require
some of the services of a context (e.g., memory storage for Skia's
internal operations, access to the GPU capability information and
some thread safe caches).

Here is my thinking wrt reviewers (lines w/ '--' are done/covered):

alcooper         chrome/browser/vr
-- blundell@     services
-- chcunningham@ media
chrishtr@        third_party/blink
-- dalecurtis@   media
-- dcastagna     components/exo
-- fmalita@      skia
-- jam@          content                  services
-- jochen@       content                  third_party/blink
oshima@          components/exo
-- penghuang@    gpu
-- rjkroege@     ui/ozone
-- spang@        ui/ozone
-- vasilyt@      android_webview/browser
-- vmpstr@       cc/layers                components/viz
-- vollick@      ui/compositor

Change-Id: I70d16e2d98cfda8d5f9b6f2492b3292500df4471
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2297920
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Alexander Cooper <alcooper@chromium.org>
Reviewed-by: Ian Vollick <vollick@chromium.org>
Reviewed-by: Chrome Cunningham <chcunningham@chromium.org>
Reviewed-by: Daniele Castagna <dcastagna@chromium.org>
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
Reviewed-by: Michael Spang <spang@chromium.org>
Reviewed-by: Robert Kroeger <rjkroege@chromium.org>
Reviewed-by: vmpstr <vmpstr@chromium.org>
Reviewed-by: Peng Huang <penghuang@chromium.org>
Reviewed-by: Vasiliy Telezhnikov <vasilyt@chromium.org>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Cr-Commit-Position: refs/heads/master@{#792721}
diff --git a/cc/raster/gpu_raster_buffer_provider.cc b/cc/raster/gpu_raster_buffer_provider.cc
index a4a6dcf..769ed855 100644
--- a/cc/raster/gpu_raster_buffer_provider.cc
+++ b/cc/raster/gpu_raster_buffer_provider.cc
@@ -7,7 +7,9 @@
 #include <stdint.h>
 
 #include <algorithm>
+#include <memory>
 #include <utility>
+#include <vector>
 
 #include "base/logging.h"
 #include "base/metrics/histogram_macros.h"
@@ -34,7 +36,7 @@
 #include "gpu/command_buffer/common/shared_image_usage.h"
 #include "third_party/skia/include/core/SkPictureRecorder.h"
 #include "third_party/skia/include/core/SkSurface.h"
-#include "third_party/skia/include/gpu/GrContext.h"
+#include "third_party/skia/include/gpu/GrDirectContext.h"
 #include "ui/gfx/geometry/axis_transform2d.h"
 #include "url/gurl.h"