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

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

Issue 72603005: Guard against most unintentionally ephemeral SkAutoFoo instantiations. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: undo autoasciitolc Created 7 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 | Annotate | Revision Log
« no previous file with comments | « src/core/SkBlitter.cpp ('k') | src/core/SkComposeShader.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 /* 2 /*
3 * Copyright 2008 The Android Open Source Project 3 * Copyright 2008 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 public: 452 public:
453 SkAutoBounderCommit(SkBounder* bounder) : fBounder(bounder) {} 453 SkAutoBounderCommit(SkBounder* bounder) : fBounder(bounder) {}
454 ~SkAutoBounderCommit() { 454 ~SkAutoBounderCommit() {
455 if (NULL != fBounder) { 455 if (NULL != fBounder) {
456 fBounder->commit(); 456 fBounder->commit();
457 } 457 }
458 } 458 }
459 private: 459 private:
460 SkBounder* fBounder; 460 SkBounder* fBounder;
461 }; 461 };
462 #define SkAutoBounderCommit(...) SK_REQUIRE_LOCAL_VAR(SkAutoBounderCommit)
462 463
463 #include "SkColorPriv.h" 464 #include "SkColorPriv.h"
464 465
465 ////////// macros to place around the internal draw calls ////////////////// 466 ////////// macros to place around the internal draw calls //////////////////
466 467
467 #define LOOPER_BEGIN_DRAWDEVICE(paint, type) \ 468 #define LOOPER_BEGIN_DRAWDEVICE(paint, type) \
468 this->predrawNotify(); \ 469 this->predrawNotify(); \
469 AutoDrawLooper looper(this, paint, true); \ 470 AutoDrawLooper looper(this, paint, true); \
470 while (looper.next(type)) { \ 471 while (looper.next(type)) { \
471 SkAutoBounderCommit ac(fBounder); \ 472 SkAutoBounderCommit ac(fBounder); \
(...skipping 1733 matching lines...) Expand 10 before | Expand all | Expand 10 after
2205 return *paint; 2206 return *paint;
2206 } 2207 }
2207 2208
2208 const SkRegion& SkCanvas::LayerIter::clip() const { return fImpl->getClip(); } 2209 const SkRegion& SkCanvas::LayerIter::clip() const { return fImpl->getClip(); }
2209 int SkCanvas::LayerIter::x() const { return fImpl->getX(); } 2210 int SkCanvas::LayerIter::x() const { return fImpl->getX(); }
2210 int SkCanvas::LayerIter::y() const { return fImpl->getY(); } 2211 int SkCanvas::LayerIter::y() const { return fImpl->getY(); }
2211 2212
2212 /////////////////////////////////////////////////////////////////////////////// 2213 ///////////////////////////////////////////////////////////////////////////////
2213 2214
2214 SkCanvas::ClipVisitor::~ClipVisitor() { } 2215 SkCanvas::ClipVisitor::~ClipVisitor() { }
OLDNEW
« no previous file with comments | « src/core/SkBlitter.cpp ('k') | src/core/SkComposeShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698