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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/InterceptingCanvas.h

Issue 2807923002: Replace ASSERT, ASSERT_NOT_REACHED, and RELEASE_ASSERT in platform/graphics (Closed)
Patch Set: fix typo Created 3 years, 8 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 (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 class CanvasInterceptorBase { 47 class CanvasInterceptorBase {
48 STACK_ALLOCATED(); 48 STACK_ALLOCATED();
49 WTF_MAKE_NONCOPYABLE(CanvasInterceptorBase); 49 WTF_MAKE_NONCOPYABLE(CanvasInterceptorBase);
50 50
51 protected: 51 protected:
52 CanvasInterceptorBase(InterceptingCanvasBase* canvas) : canvas_(canvas) { 52 CanvasInterceptorBase(InterceptingCanvasBase* canvas) : canvas_(canvas) {
53 ++canvas_->call_nesting_depth_; 53 ++canvas_->call_nesting_depth_;
54 } 54 }
55 55
56 ~CanvasInterceptorBase() { 56 ~CanvasInterceptorBase() {
57 ASSERT(canvas_->call_nesting_depth_ > 0); 57 DCHECK_GT(canvas_->call_nesting_depth_, 0u);
58 if (!--canvas_->call_nesting_depth_) 58 if (!--canvas_->call_nesting_depth_)
59 canvas_->call_count_++; 59 canvas_->call_count_++;
60 } 60 }
61 61
62 DerivedCanvas* Canvas() { return static_cast<DerivedCanvas*>(canvas_); } 62 DerivedCanvas* Canvas() { return static_cast<DerivedCanvas*>(canvas_); }
63 bool TopLevelCall() const { return canvas_->CallNestingDepth() == 1; } 63 bool TopLevelCall() const { return canvas_->CallNestingDepth() == 1; }
64 InterceptingCanvasBase* canvas_; 64 InterceptingCanvasBase* canvas_;
65 }; 65 };
66 66
67 void ResetStepCount() { call_count_ = 0; } 67 void ResetStepCount() { call_count_ = 0; }
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 358
359 void willRestore() override { 359 void willRestore() override {
360 Interceptor interceptor(this); 360 Interceptor interceptor(this);
361 this->SkCanvas::willRestore(); 361 this->SkCanvas::willRestore();
362 } 362 }
363 }; 363 };
364 364
365 } // namespace blink 365 } // namespace blink
366 366
367 #endif // InterceptingCanvas_h 367 #endif // InterceptingCanvas_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698