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

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

Issue 2146073003: Creating framework for drawShadowedPicture (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Added setLights and getLIghts calls Created 4 years, 5 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
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 1536 matching lines...) Expand 10 before | Expand all | Expand 10 after
1547 void SkCanvas::translateZ(SkScalar z) { 1547 void SkCanvas::translateZ(SkScalar z) {
1548 this->checkForDeferredSave(); 1548 this->checkForDeferredSave();
1549 this->fMCRec->fCurDrawDepth += z; 1549 this->fMCRec->fCurDrawDepth += z;
1550 this->didTranslateZ(z); 1550 this->didTranslateZ(z);
1551 } 1551 }
1552 1552
1553 SkScalar SkCanvas::getZ() const { 1553 SkScalar SkCanvas::getZ() const {
1554 return this->fMCRec->fCurDrawDepth; 1554 return this->fMCRec->fCurDrawDepth;
1555 } 1555 }
1556 1556
1557 void SkCanvas::setLights(sk_sp<SkLights> lights) {
1558 this->fLights = lights;
1559 }
1560
1561 sk_sp<SkLights> SkCanvas::getLights() {
1562 return this->fLights;
1563 }}
jvanverth1 2016/07/15 19:16:30 Extra } ?
1564
1557 ////////////////////////////////////////////////////////////////////////////// 1565 //////////////////////////////////////////////////////////////////////////////
1558 1566
1559 void SkCanvas::clipRect(const SkRect& rect, SkRegion::Op op, bool doAA) { 1567 void SkCanvas::clipRect(const SkRect& rect, SkRegion::Op op, bool doAA) {
1560 if (!fAllowSoftClip) { 1568 if (!fAllowSoftClip) {
1561 doAA = false; 1569 doAA = false;
1562 } 1570 }
1563 1571
1564 #ifdef SK_SUPPORT_PRECHECK_CLIPRECT 1572 #ifdef SK_SUPPORT_PRECHECK_CLIPRECT
1565 // Check if we can quick-accept the clip call (and do nothing) 1573 // Check if we can quick-accept the clip call (and do nothing)
1566 // 1574 //
(...skipping 1457 matching lines...) Expand 10 before | Expand all | Expand 10 after
3024 } 3032 }
3025 if (this->quickReject(bounds)) { 3033 if (this->quickReject(bounds)) {
3026 return; 3034 return;
3027 } 3035 }
3028 } 3036 }
3029 3037
3030 SkAutoCanvasMatrixPaint acmp(this, matrix, paint, picture->cullRect()); 3038 SkAutoCanvasMatrixPaint acmp(this, matrix, paint, picture->cullRect());
3031 picture->playback(this); 3039 picture->playback(this);
3032 } 3040 }
3033 3041
3042 void SkCanvas::drawShadowedPicture(const SkPicture* picture,
3043 const SkMatrix* matrix,
3044 const SkPaint* paint) {
3045 RETURN_ON_NULL(picture);
3046
3047 TRACE_EVENT0("disabled-by-default-skia", "SkCanvas::drawShadowedPicture()");
3048
3049 this->onDrawShadowedPicture(picture, matrix, paint);
3050 }
3051
3052 void SkCanvas::onDrawShadowedPicture(const SkPicture* picture,
3053 const SkMatrix* matrix,
3054 const SkPaint* paint) {
3055 this->onDrawPicture(picture, matrix, paint);
3056 }
3057
3034 /////////////////////////////////////////////////////////////////////////////// 3058 ///////////////////////////////////////////////////////////////////////////////
3035 /////////////////////////////////////////////////////////////////////////////// 3059 ///////////////////////////////////////////////////////////////////////////////
3036 3060
3037 SkCanvas::LayerIter::LayerIter(SkCanvas* canvas, bool skipEmptyClips) { 3061 SkCanvas::LayerIter::LayerIter(SkCanvas* canvas, bool skipEmptyClips) {
3038 static_assert(sizeof(fStorage) >= sizeof(SkDrawIter), "fStorage_too_small"); 3062 static_assert(sizeof(fStorage) >= sizeof(SkDrawIter), "fStorage_too_small");
3039 3063
3040 SkASSERT(canvas); 3064 SkASSERT(canvas);
3041 3065
3042 fImpl = new (fStorage) SkDrawIter(canvas, skipEmptyClips); 3066 fImpl = new (fStorage) SkDrawIter(canvas, skipEmptyClips);
3043 fDone = !fImpl->next(); 3067 fDone = !fImpl->next();
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
3134 3158
3135 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { 3159 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() {
3136 fCanvas->restoreToCount(fSaveCount); 3160 fCanvas->restoreToCount(fSaveCount);
3137 } 3161 }
3138 3162
3139 #ifdef SK_SUPPORT_LEGACY_NEW_SURFACE_API 3163 #ifdef SK_SUPPORT_LEGACY_NEW_SURFACE_API
3140 SkSurface* SkCanvas::newSurface(const SkImageInfo& info, const SkSurfaceProps* p rops) { 3164 SkSurface* SkCanvas::newSurface(const SkImageInfo& info, const SkSurfaceProps* p rops) {
3141 return this->makeSurface(info, props).release(); 3165 return this->makeSurface(info, props).release();
3142 } 3166 }
3143 #endif 3167 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698