OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |