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

Side by Side Diff: Source/platform/graphics/LoggingCanvas.cpp

Issue 777413004: clear() is now an alias for drawPaint, and will be deprecated as a virtual (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years 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 | « Source/platform/graphics/LoggingCanvas.h ('k') | Source/platform/graphics/ProfilingCanvas.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 (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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 m_canvas->m_depthCount--; 77 m_canvas->m_depthCount--;
78 if (!m_canvas->m_depthCount) 78 if (!m_canvas->m_depthCount)
79 m_canvas->m_log->pushObject(m_logItem); 79 m_canvas->m_log->pushObject(m_logItem);
80 } 80 }
81 81
82 LoggingCanvas::LoggingCanvas(int width, int height) : InterceptingCanvas(width, height) 82 LoggingCanvas::LoggingCanvas(int width, int height) : InterceptingCanvas(width, height)
83 { 83 {
84 m_log = JSONArray::create(); 84 m_log = JSONArray::create();
85 } 85 }
86 86
87 void LoggingCanvas::clear(SkColor color)
88 {
89 AutoLogger logger(this);
90 logger.logItemWithParams("clear")->setString("color", stringForSkColor(color ));
91 this->SkCanvas::clear(color);
92 }
93
94 void LoggingCanvas::drawPaint(const SkPaint& paint) 87 void LoggingCanvas::drawPaint(const SkPaint& paint)
95 { 88 {
96 AutoLogger logger(this); 89 AutoLogger logger(this);
97 logger.logItemWithParams("drawPaint")->setObject("paint", objectForSkPaint(p aint)); 90 logger.logItemWithParams("drawPaint")->setObject("paint", objectForSkPaint(p aint));
98 this->SkCanvas::drawPaint(paint); 91 this->SkCanvas::drawPaint(paint);
99 } 92 }
100 93
101 void LoggingCanvas::drawPoints(PointMode mode, size_t count, const SkPoint pts[] , const SkPaint& paint) 94 void LoggingCanvas::drawPoints(PointMode mode, size_t count, const SkPoint pts[] , const SkPaint& paint)
102 { 95 {
103 AutoLogger logger(this); 96 AutoLogger logger(this);
(...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after
885 paint.glyphsToUnichars(static_cast<const uint16_t*>(text), byteLength / 2, textData); 878 paint.glyphsToUnichars(static_cast<const uint16_t*>(text), byteLength / 2, textData);
886 return WTF::UTF32LittleEndianEncoding().decode(reinterpret_cast<const ch ar*>(textData), byteLength * 2); 879 return WTF::UTF32LittleEndianEncoding().decode(reinterpret_cast<const ch ar*>(textData), byteLength * 2);
887 } 880 }
888 default: 881 default:
889 ASSERT_NOT_REACHED(); 882 ASSERT_NOT_REACHED();
890 return "?"; 883 return "?";
891 } 884 }
892 } 885 }
893 886
894 } // namespace blink 887 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/graphics/LoggingCanvas.h ('k') | Source/platform/graphics/ProfilingCanvas.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698