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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/ReplayingCanvas.cpp

Issue 2044643006: DevTools: clear layers using transparent color (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 | « no previous file | no next file » | 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 (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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 } 44 }
45 45
46 void ReplayingCanvas::updateInRange() 46 void ReplayingCanvas::updateInRange()
47 { 47 {
48 if (m_abortDrawing) 48 if (m_abortDrawing)
49 return; 49 return;
50 unsigned step = callCount() + 1; 50 unsigned step = callCount() + 1;
51 if (m_toStep && step > m_toStep) 51 if (m_toStep && step > m_toStep)
52 m_abortDrawing = true; 52 m_abortDrawing = true;
53 if (step == m_fromStep) 53 if (step == m_fromStep)
54 this->SkCanvas::clear(SkColorSetARGB(255, 255, 255, 255)); // FIXME: fil l with nine patch instead. 54 this->SkCanvas::clear(SK_ColorTRANSPARENT);
55 } 55 }
56 56
57 bool ReplayingCanvas::abort() 57 bool ReplayingCanvas::abort()
58 { 58 {
59 return m_abortDrawing; 59 return m_abortDrawing;
60 } 60 }
61 61
62 SkCanvas::SaveLayerStrategy ReplayingCanvas::getSaveLayerStrategy(const SaveLaye rRec& rec) 62 SkCanvas::SaveLayerStrategy ReplayingCanvas::getSaveLayerStrategy(const SaveLaye rRec& rec)
63 { 63 {
64 // We're about to create a layer and we have not cleared the device yet. 64 // We're about to create a layer and we have not cleared the device yet.
65 // Let's clear now, so it has effect on all layers. 65 // Let's clear now, so it has effect on all layers.
66 if (callCount() <= m_fromStep) 66 if (callCount() <= m_fromStep)
67 this->SkCanvas::clear(SkColorSetARGB(255, 255, 255, 255)); // FIXME: fil l with nine patch instead. 67 this->SkCanvas::clear(SK_ColorTRANSPARENT);
68 68
69 return this->InterceptingCanvas<ReplayingCanvas>::getSaveLayerStrategy(rec); 69 return this->InterceptingCanvas<ReplayingCanvas>::getSaveLayerStrategy(rec);
70 } 70 }
71 71
72 void ReplayingCanvas::onDrawPicture(const SkPicture* picture, const SkMatrix* ma trix, const SkPaint* paint) 72 void ReplayingCanvas::onDrawPicture(const SkPicture* picture, const SkMatrix* ma trix, const SkPaint* paint)
73 { 73 {
74 this->unrollDrawPicture(picture, matrix, paint, this); 74 this->unrollDrawPicture(picture, matrix, paint, this);
75 } 75 }
76 76
77 } // namespace blink 77 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698