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

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

Issue 727363003: wip for drawables (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: make the pictures in the array also const (the array already was const) Created 6 years, 1 month 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 | « samplecode/SampleArc.cpp ('k') | src/core/SkCanvasDrawable.h » ('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 "SkCanvas.h" 8 #include "SkCanvas.h"
9 #include "SkCanvasDrawable.h" 9 #include "SkCanvasDrawable.h"
10 #include "SkCanvasPriv.h" 10 #include "SkCanvasPriv.h"
(...skipping 2281 matching lines...) Expand 10 before | Expand all | Expand 10 after
2292 LOOPER_BEGIN(paint, SkDrawFilter::kPath_Type, NULL) 2292 LOOPER_BEGIN(paint, SkDrawFilter::kPath_Type, NULL)
2293 2293
2294 while (iter.next()) { 2294 while (iter.next()) {
2295 iter.fDevice->drawPatch(iter, cubics, colors, texCoords, xmode, paint); 2295 iter.fDevice->drawPatch(iter, cubics, colors, texCoords, xmode, paint);
2296 } 2296 }
2297 2297
2298 LOOPER_END 2298 LOOPER_END
2299 } 2299 }
2300 2300
2301 void SkCanvas::EXPERIMENTAL_drawDrawable(SkCanvasDrawable* dr) { 2301 void SkCanvas::EXPERIMENTAL_drawDrawable(SkCanvasDrawable* dr) {
2302 if (dr) { 2302 if (dr && !this->quickReject(dr->getBounds())) {
2303 SkRect bounds; 2303 this->onDrawDrawable(dr);
2304 if (!dr->getBounds(&bounds) || !this->quickReject(bounds)) {
2305 this->onDrawDrawable(dr);
2306 }
2307 } 2304 }
2308 } 2305 }
2309 2306
2310 void SkCanvas::onDrawDrawable(SkCanvasDrawable* dr) { 2307 void SkCanvas::onDrawDrawable(SkCanvasDrawable* dr) {
2311 dr->draw(this); 2308 dr->draw(this);
2312 } 2309 }
2313 2310
2314 ////////////////////////////////////////////////////////////////////////////// 2311 //////////////////////////////////////////////////////////////////////////////
2315 // These methods are NOT virtual, and therefore must call back into virtual 2312 // These methods are NOT virtual, and therefore must call back into virtual
2316 // methods, rather than actually drawing themselves. 2313 // methods, rather than actually drawing themselves.
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
2584 } 2581 }
2585 2582
2586 if (matrix) { 2583 if (matrix) {
2587 canvas->concat(*matrix); 2584 canvas->concat(*matrix);
2588 } 2585 }
2589 } 2586 }
2590 2587
2591 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { 2588 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() {
2592 fCanvas->restoreToCount(fSaveCount); 2589 fCanvas->restoreToCount(fSaveCount);
2593 } 2590 }
OLDNEW
« no previous file with comments | « samplecode/SampleArc.cpp ('k') | src/core/SkCanvasDrawable.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698