Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(141)

Unified Diff: src/core/SkCanvas.cpp

Issue 1922123002: make context() virtual on device (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/core/SkDevice.h ('k') | src/gpu/SkGpuDevice.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkCanvas.cpp
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index 3924260f809468a77d45bd93ae6264ec56af3572..905849254c7fcf5ad6689fe9354cc326ff395992 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -1863,18 +1863,8 @@ GrRenderTarget* SkCanvas::internal_private_accessTopLayerRenderTarget() {
}
GrContext* SkCanvas::getGrContext() {
-#if SK_SUPPORT_GPU
SkBaseDevice* device = this->getTopDevice();
- if (device) {
- GrRenderTarget* renderTarget = device->accessRenderTarget();
- if (renderTarget) {
- return renderTarget->getContext();
- }
- }
-#endif
-
- return nullptr;
-
+ return device ? device->context() : nullptr;
}
void SkCanvas::drawDRRect(const SkRRect& outer, const SkRRect& inner,
« no previous file with comments | « include/core/SkDevice.h ('k') | src/gpu/SkGpuDevice.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698