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

Side by Side Diff: Source/core/platform/PlatformInstrumentation.h

Issue 16896007: Timeline: add support for deferred canvas rasterization (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 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 28 matching lines...) Expand all
39 namespace WebCore { 39 namespace WebCore {
40 40
41 class PlatformInstrumentationClient { 41 class PlatformInstrumentationClient {
42 public: 42 public:
43 virtual ~PlatformInstrumentationClient(); 43 virtual ~PlatformInstrumentationClient();
44 44
45 virtual void willDecodeImage(const String& imageType) = 0; 45 virtual void willDecodeImage(const String& imageType) = 0;
46 virtual void didDecodeImage() = 0; 46 virtual void didDecodeImage() = 0;
47 virtual void willResizeImage(bool shouldCache) = 0; 47 virtual void willResizeImage(bool shouldCache) = 0;
48 virtual void didResizeImage() = 0; 48 virtual void didResizeImage() = 0;
49 virtual void willRasterizeCanvas() = 0;
50 virtual void didRasterizeCanvas() = 0;
49 }; 51 };
50 52
51 class PlatformInstrumentation { 53 class PlatformInstrumentation {
52 public: 54 public:
53 static const char ImageDecodeEvent[]; 55 static const char ImageDecodeEvent[];
54 static const char ImageResizeEvent[]; 56 static const char ImageResizeEvent[];
55 57
56 static const char ImageTypeArgument[]; 58 static const char ImageTypeArgument[];
57 static const char CachedArgument[]; 59 static const char CachedArgument[];
58 60
59 static void setClient(PlatformInstrumentationClient*); 61 static void setClient(PlatformInstrumentationClient*);
60 static bool hasClient() { return m_client; } 62 static bool hasClient() { return m_client; }
61 63
62 static void willDecodeImage(const String& imageType); 64 static void willDecodeImage(const String& imageType);
63 static void didDecodeImage(); 65 static void didDecodeImage();
64 static void willResizeImage(bool shouldCache); 66 static void willResizeImage(bool shouldCache);
65 static void didResizeImage(); 67 static void didResizeImage();
68 static void willRasterizeCanvas();
69 static void didRasterizeCanvas();
66 70
67 private: 71 private:
68 static const char CategoryName[]; 72 static const char CategoryName[];
69 73
70 static PlatformInstrumentationClient* m_client; 74 static PlatformInstrumentationClient* m_client;
71 }; 75 };
72 76
73 #define FAST_RETURN_IF_NO_CLIENT_OR_NOT_MAIN_THREAD() if (!m_client || !isMainTh read()) return; 77 #define FAST_RETURN_IF_NO_CLIENT_OR_NOT_MAIN_THREAD() if (!m_client || !isMainTh read()) return;
74 78
75 inline void PlatformInstrumentation::willDecodeImage(const String& imageType) 79 inline void PlatformInstrumentation::willDecodeImage(const String& imageType)
(...skipping 17 matching lines...) Expand all
93 m_client->willResizeImage(shouldCache); 97 m_client->willResizeImage(shouldCache);
94 } 98 }
95 99
96 inline void PlatformInstrumentation::didResizeImage() 100 inline void PlatformInstrumentation::didResizeImage()
97 { 101 {
98 TRACE_EVENT_END0(CategoryName, ImageResizeEvent); 102 TRACE_EVENT_END0(CategoryName, ImageResizeEvent);
99 FAST_RETURN_IF_NO_CLIENT_OR_NOT_MAIN_THREAD(); 103 FAST_RETURN_IF_NO_CLIENT_OR_NOT_MAIN_THREAD();
100 m_client->didResizeImage(); 104 m_client->didResizeImage();
101 } 105 }
102 106
107 inline void PlatformInstrumentation::willRasterizeCanvas()
108 {
109 FAST_RETURN_IF_NO_CLIENT_OR_NOT_MAIN_THREAD();
110 m_client->willRasterizeCanvas();
111 }
112
113 inline void PlatformInstrumentation::didRasterizeCanvas()
114 {
115 FAST_RETURN_IF_NO_CLIENT_OR_NOT_MAIN_THREAD();
116 m_client->didRasterizeCanvas();
117 }
118
103 } // namespace WebCore 119 } // namespace WebCore
104 120
105 #endif // PlatformInstrumentation_h 121 #endif // PlatformInstrumentation_h
OLDNEW
« no previous file with comments | « Source/core/inspector/InspectorTimelineAgent.cpp ('k') | Source/core/platform/graphics/chromium/Canvas2DLayerBridge.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698