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

Side by Side Diff: src/core/SkCanvas.cpp

Issue 1986383002: SkCanvas::adjustToTopLayer() (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Mike's comments 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/SkCanvas.h ('k') | tests/CanvasTest.cpp » ('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 2018 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « include/core/SkCanvas.h ('k') | tests/CanvasTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698