aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu
diff options
context:
space:
mode:
authorGravatar robertphillips <robertphillips@google.com>2016-04-28 14:32:04 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-04-28 14:32:04 -0700
commit175dd9b5e3d7d749738dac743d2ac360b5340187 (patch)
treeff0ab4b2fb12c714a1723775d031220a68225d6d /src/gpu
parent801b44c45348144a483793e7b24f4d4092a4f74d (diff)
Clean up test drawContext usage
The general idea is to provide access to SkGpuDevice's drawContext rather than its GrRenderTarget. That is usually what the testing framework actually wants. GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1930623003 Review-Url: https://codereview.chromium.org/1930623003
Diffstat (limited to 'src/gpu')
-rw-r--r--src/gpu/SkGpuDevice.cpp5
-rw-r--r--src/gpu/SkGpuDevice.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 78b3cfc7d0..0e6eb92537 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -347,6 +347,11 @@ GrRenderTarget* SkGpuDevice::accessRenderTarget() {
return fRenderTarget;
}
+GrDrawContext* SkGpuDevice::accessDrawContext() {
+ ASSERT_SINGLE_OWNER
+ return fDrawContext.get();
+}
+
void SkGpuDevice::clearAll() {
ASSERT_SINGLE_OWNER
GrColor color = 0;
diff --git a/src/gpu/SkGpuDevice.h b/src/gpu/SkGpuDevice.h
index 49bf13c438..8420449a9a 100644
--- a/src/gpu/SkGpuDevice.h
+++ b/src/gpu/SkGpuDevice.h
@@ -71,6 +71,7 @@ public:
void replaceRenderTarget(bool shouldRetainContent);
GrRenderTarget* accessRenderTarget() override;
+ GrDrawContext* accessDrawContext() override;
SkImageInfo imageInfo() const override {
return fLegacyBitmap.info();