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

Side by Side 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, 7 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 unified diff | Download patch
« no previous file with comments | « include/core/SkDevice.h ('k') | src/gpu/SkGpuDevice.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2008 The Android Open Source Project 2 * Copyright 2008 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkBitmapDevice.h" 8 #include "SkBitmapDevice.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkCanvasPriv.h" 10 #include "SkCanvasPriv.h"
(...skipping 1845 matching lines...) Expand 10 before | Expand all | Expand 10 after
1856 const SkRegion& SkCanvas::internal_private_getTotalClip() const { 1856 const SkRegion& SkCanvas::internal_private_getTotalClip() const {
1857 return fMCRec->fRasterClip.forceGetBW(); 1857 return fMCRec->fRasterClip.forceGetBW();
1858 } 1858 }
1859 1859
1860 GrRenderTarget* SkCanvas::internal_private_accessTopLayerRenderTarget() { 1860 GrRenderTarget* SkCanvas::internal_private_accessTopLayerRenderTarget() {
1861 SkBaseDevice* dev = this->getTopDevice(); 1861 SkBaseDevice* dev = this->getTopDevice();
1862 return dev ? dev->accessRenderTarget() : nullptr; 1862 return dev ? dev->accessRenderTarget() : nullptr;
1863 } 1863 }
1864 1864
1865 GrContext* SkCanvas::getGrContext() { 1865 GrContext* SkCanvas::getGrContext() {
1866 #if SK_SUPPORT_GPU
1867 SkBaseDevice* device = this->getTopDevice(); 1866 SkBaseDevice* device = this->getTopDevice();
1868 if (device) { 1867 return device ? device->context() : nullptr;
1869 GrRenderTarget* renderTarget = device->accessRenderTarget();
1870 if (renderTarget) {
1871 return renderTarget->getContext();
1872 }
1873 }
1874 #endif
1875
1876 return nullptr;
1877
1878 } 1868 }
1879 1869
1880 void SkCanvas::drawDRRect(const SkRRect& outer, const SkRRect& inner, 1870 void SkCanvas::drawDRRect(const SkRRect& outer, const SkRRect& inner,
1881 const SkPaint& paint) { 1871 const SkPaint& paint) {
1882 TRACE_EVENT0("disabled-by-default-skia", "SkCanvas::drawDRRect()"); 1872 TRACE_EVENT0("disabled-by-default-skia", "SkCanvas::drawDRRect()");
1883 if (outer.isEmpty()) { 1873 if (outer.isEmpty()) {
1884 return; 1874 return;
1885 } 1875 }
1886 if (inner.isEmpty()) { 1876 if (inner.isEmpty()) {
1887 this->drawRRect(outer, paint); 1877 this->drawRRect(outer, paint);
(...skipping 1183 matching lines...) Expand 10 before | Expand all | Expand 10 after
3071 3061
3072 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { 3062 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() {
3073 fCanvas->restoreToCount(fSaveCount); 3063 fCanvas->restoreToCount(fSaveCount);
3074 } 3064 }
3075 3065
3076 #ifdef SK_SUPPORT_LEGACY_NEW_SURFACE_API 3066 #ifdef SK_SUPPORT_LEGACY_NEW_SURFACE_API
3077 SkSurface* SkCanvas::newSurface(const SkImageInfo& info, const SkSurfaceProps* p rops) { 3067 SkSurface* SkCanvas::newSurface(const SkImageInfo& info, const SkSurfaceProps* p rops) {
3078 return this->makeSurface(info, props).release(); 3068 return this->makeSurface(info, props).release();
3079 } 3069 }
3080 #endif 3070 #endif
OLDNEW
« 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