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

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

Issue 1761793003: Revert of move annotations to canvas virtual (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 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 | « src/core/SkBitmapDevice.cpp ('k') | src/core/SkPaint.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 1955 matching lines...) Expand 10 before | Expand all | Expand 10 after
1966 RETURN_ON_NULL(atlas); 1966 RETURN_ON_NULL(atlas);
1967 if (count <= 0) { 1967 if (count <= 0) {
1968 return; 1968 return;
1969 } 1969 }
1970 SkASSERT(atlas); 1970 SkASSERT(atlas);
1971 SkASSERT(xform); 1971 SkASSERT(xform);
1972 SkASSERT(tex); 1972 SkASSERT(tex);
1973 this->onDrawAtlas(atlas, xform, tex, colors, count, mode, cull, paint); 1973 this->onDrawAtlas(atlas, xform, tex, colors, count, mode, cull, paint);
1974 } 1974 }
1975 1975
1976 void SkCanvas::drawAnnotation(const SkRect& rect, const char key[], SkData* valu e) {
1977 if (key) {
1978 this->onDrawAnnotation(rect, key, value);
1979 }
1980 }
1981
1982 void SkCanvas::legacy_drawImageRect(const SkImage* image, const SkRect* src, con st SkRect& dst, 1976 void SkCanvas::legacy_drawImageRect(const SkImage* image, const SkRect* src, con st SkRect& dst,
1983 const SkPaint* paint, SrcRectConstraint cons traint) { 1977 const SkPaint* paint, SrcRectConstraint cons traint) {
1984 if (src) { 1978 if (src) {
1985 this->drawImageRect(image, *src, dst, paint, constraint); 1979 this->drawImageRect(image, *src, dst, paint, constraint);
1986 } else { 1980 } else {
1987 this->drawImageRect(image, SkRect::MakeIWH(image->width(), image->height ()), 1981 this->drawImageRect(image, SkRect::MakeIWH(image->width(), image->height ()),
1988 dst, paint, constraint); 1982 dst, paint, constraint);
1989 } 1983 }
1990 } 1984 }
1991 void SkCanvas::legacy_drawBitmapRect(const SkBitmap& bitmap, const SkRect* src, const SkRect& dst, 1985 void SkCanvas::legacy_drawBitmapRect(const SkBitmap& bitmap, const SkRect* src, const SkRect& dst,
(...skipping 732 matching lines...) Expand 10 before | Expand all | Expand 10 after
2724 pnt = *paint; 2718 pnt = *paint;
2725 } 2719 }
2726 2720
2727 LOOPER_BEGIN(pnt, SkDrawFilter::kPath_Type, nullptr) 2721 LOOPER_BEGIN(pnt, SkDrawFilter::kPath_Type, nullptr)
2728 while (iter.next()) { 2722 while (iter.next()) {
2729 iter.fDevice->drawAtlas(iter, atlas, xform, tex, colors, count, mode, pn t); 2723 iter.fDevice->drawAtlas(iter, atlas, xform, tex, colors, count, mode, pn t);
2730 } 2724 }
2731 LOOPER_END 2725 LOOPER_END
2732 } 2726 }
2733 2727
2734 void SkCanvas::onDrawAnnotation(const SkRect& rect, const char key[], SkData* va lue) {
2735 SkASSERT(key);
2736
2737 SkPaint paint;
2738 LOOPER_BEGIN(paint, SkDrawFilter::kRect_Type, nullptr)
2739 while (iter.next()) {
2740 iter.fDevice->drawAnnotation(iter, rect, key, value);
2741 }
2742 LOOPER_END
2743 }
2744
2745 ////////////////////////////////////////////////////////////////////////////// 2728 //////////////////////////////////////////////////////////////////////////////
2746 // These methods are NOT virtual, and therefore must call back into virtual 2729 // These methods are NOT virtual, and therefore must call back into virtual
2747 // methods, rather than actually drawing themselves. 2730 // methods, rather than actually drawing themselves.
2748 ////////////////////////////////////////////////////////////////////////////// 2731 //////////////////////////////////////////////////////////////////////////////
2749 2732
2750 void SkCanvas::drawARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b, 2733 void SkCanvas::drawARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b,
2751 SkXfermode::Mode mode) { 2734 SkXfermode::Mode mode) {
2752 TRACE_EVENT0("disabled-by-default-skia", "SkCanvas::drawARGB()"); 2735 TRACE_EVENT0("disabled-by-default-skia", "SkCanvas::drawARGB()");
2753 SkPaint paint; 2736 SkPaint paint;
2754 2737
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
3018 } 3001 }
3019 3002
3020 if (matrix) { 3003 if (matrix) {
3021 canvas->concat(*matrix); 3004 canvas->concat(*matrix);
3022 } 3005 }
3023 } 3006 }
3024 3007
3025 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { 3008 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() {
3026 fCanvas->restoreToCount(fSaveCount); 3009 fCanvas->restoreToCount(fSaveCount);
3027 } 3010 }
OLDNEW
« no previous file with comments | « src/core/SkBitmapDevice.cpp ('k') | src/core/SkPaint.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698