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 2018 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2029 void SkCanvas::legacy_drawBitmapRect(const SkBitmap& bitmap, const SkRect* src,
const SkRect& dst, | 2029 void SkCanvas::legacy_drawBitmapRect(const SkBitmap& bitmap, const SkRect* src,
const SkRect& dst, |
2030 const SkPaint* paint, SrcRectConstraint con
straint) { | 2030 const SkPaint* paint, SrcRectConstraint con
straint) { |
2031 if (src) { | 2031 if (src) { |
2032 this->drawBitmapRect(bitmap, *src, dst, paint, constraint); | 2032 this->drawBitmapRect(bitmap, *src, dst, paint, constraint); |
2033 } else { | 2033 } else { |
2034 this->drawBitmapRect(bitmap, SkRect::MakeIWH(bitmap.width(), bitmap.heig
ht()), | 2034 this->drawBitmapRect(bitmap, SkRect::MakeIWH(bitmap.width(), bitmap.heig
ht()), |
2035 dst, paint, constraint); | 2035 dst, paint, constraint); |
2036 } | 2036 } |
2037 } | 2037 } |
2038 | 2038 |
| 2039 void SkCanvas::temporary_internal_describeTopLayer(SkMatrix* matrix, SkIRect* cl
ip_bounds) { |
| 2040 SkIRect layer_bounds = this->getTopLayerBounds(); |
| 2041 if (matrix) { |
| 2042 *matrix = this->getTotalMatrix(); |
| 2043 matrix->preTranslate(-layer_bounds.left(), -layer_bounds.top()); |
| 2044 } |
| 2045 if (clip_bounds) { |
| 2046 this->getClipDeviceBounds(clip_bounds); |
| 2047 clip_bounds->offset(-layer_bounds.left(), -layer_bounds.top()); |
| 2048 } |
| 2049 } |
| 2050 |
2039 ////////////////////////////////////////////////////////////////////////////// | 2051 ////////////////////////////////////////////////////////////////////////////// |
2040 // These are the virtual drawing methods | 2052 // These are the virtual drawing methods |
2041 ////////////////////////////////////////////////////////////////////////////// | 2053 ////////////////////////////////////////////////////////////////////////////// |
2042 | 2054 |
2043 void SkCanvas::onDiscard() { | 2055 void SkCanvas::onDiscard() { |
2044 if (fSurfaceBase) { | 2056 if (fSurfaceBase) { |
2045 fSurfaceBase->aboutToDraw(SkSurface::kDiscard_ContentChangeMode); | 2057 fSurfaceBase->aboutToDraw(SkSurface::kDiscard_ContentChangeMode); |
2046 } | 2058 } |
2047 } | 2059 } |
2048 | 2060 |
(...skipping 1013 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3062 | 3074 |
3063 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { | 3075 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { |
3064 fCanvas->restoreToCount(fSaveCount); | 3076 fCanvas->restoreToCount(fSaveCount); |
3065 } | 3077 } |
3066 | 3078 |
3067 #ifdef SK_SUPPORT_LEGACY_NEW_SURFACE_API | 3079 #ifdef SK_SUPPORT_LEGACY_NEW_SURFACE_API |
3068 SkSurface* SkCanvas::newSurface(const SkImageInfo& info, const SkSurfaceProps* p
rops) { | 3080 SkSurface* SkCanvas::newSurface(const SkImageInfo& info, const SkSurfaceProps* p
rops) { |
3069 return this->makeSurface(info, props).release(); | 3081 return this->makeSurface(info, props).release(); |
3070 } | 3082 } |
3071 #endif | 3083 #endif |
OLD | NEW |