| OLD | NEW |
| 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 void CCOverdrawMetrics::recordMetrics(const CCLayerTreeHostImpl* layerTreeHost)
const | 124 void CCOverdrawMetrics::recordMetrics(const CCLayerTreeHostImpl* layerTreeHost)
const |
| 125 { | 125 { |
| 126 if (m_recordMetricsForFrame) | 126 if (m_recordMetricsForFrame) |
| 127 recordMetricsInternal<CCLayerTreeHostImpl>(DrawingToScreen, layerTreeHos
t); | 127 recordMetricsInternal<CCLayerTreeHostImpl>(DrawingToScreen, layerTreeHos
t); |
| 128 } | 128 } |
| 129 | 129 |
| 130 template<typename LayerTreeHostType> | 130 template<typename LayerTreeHostType> |
| 131 void CCOverdrawMetrics::recordMetricsInternal(MetricsType metricsType, const Lay
erTreeHostType* layerTreeHost) const | 131 void CCOverdrawMetrics::recordMetricsInternal(MetricsType metricsType, const Lay
erTreeHostType* layerTreeHost) const |
| 132 { | 132 { |
| 133 // This gives approximately 10x the percentage of pixels to fill the viewpor
t once. | 133 // This gives approximately 10x the percentage of pixels to fill the viewpor
t once. |
| 134 float normalization = 1000.f / (layerTreeHost->viewportSize().width() * laye
rTreeHost->viewportSize().height()); | 134 float normalization = 1000.f / (layerTreeHost->deviceViewportSize().width()
* layerTreeHost->deviceViewportSize().height()); |
| 135 // This gives approximately 100x the percentage of tiles to fill the viewpor
t once, if all tiles were 256x256. | 135 // This gives approximately 100x the percentage of tiles to fill the viewpor
t once, if all tiles were 256x256. |
| 136 float tileNormalization = 10000.f / (layerTreeHost->viewportSize().width() /
256.f * layerTreeHost->viewportSize().height() / 256.f); | 136 float tileNormalization = 10000.f / (layerTreeHost->deviceViewportSize().wid
th() / 256.f * layerTreeHost->deviceViewportSize().height() / 256.f); |
| 137 | 137 |
| 138 switch (metricsType) { | 138 switch (metricsType) { |
| 139 case DrawingToScreen: | 139 case DrawingToScreen: |
| 140 WebKit::Platform::current()->histogramCustomCounts("Renderer4.pixelCount
Opaque_Draw", static_cast<int>(normalization * m_pixelsDrawnOpaque), 100, 100000
0, 50); | 140 WebKit::Platform::current()->histogramCustomCounts("Renderer4.pixelCount
Opaque_Draw", static_cast<int>(normalization * m_pixelsDrawnOpaque), 100, 100000
0, 50); |
| 141 WebKit::Platform::current()->histogramCustomCounts("Renderer4.pixelCount
Translucent_Draw", static_cast<int>(normalization * m_pixelsDrawnTranslucent), 1
00, 1000000, 50); | 141 WebKit::Platform::current()->histogramCustomCounts("Renderer4.pixelCount
Translucent_Draw", static_cast<int>(normalization * m_pixelsDrawnTranslucent), 1
00, 1000000, 50); |
| 142 WebKit::Platform::current()->histogramCustomCounts("Renderer4.pixelCount
Culled_Draw", static_cast<int>(normalization * m_pixelsCulledForDrawing), 100, 1
000000, 50); | 142 WebKit::Platform::current()->histogramCustomCounts("Renderer4.pixelCount
Culled_Draw", static_cast<int>(normalization * m_pixelsCulledForDrawing), 100, 1
000000, 50); |
| 143 | 143 |
| 144 { | 144 { |
| 145 TRACE_COUNTER_ID1("webkit", "DrawPixelsCulled", layerTreeHost, m_pix
elsCulledForDrawing); | 145 TRACE_COUNTER_ID1("cc", "DrawPixelsCulled", layerTreeHost, m_pixelsC
ulledForDrawing); |
| 146 TRACE_EVENT2("webkit", "CCOverdrawMetrics", "PixelsDrawnOpaque", m_p
ixelsDrawnOpaque, "PixelsDrawnTranslucent", m_pixelsDrawnTranslucent); | 146 TRACE_EVENT2("cc", "CCOverdrawMetrics", "PixelsDrawnOpaque", m_pixel
sDrawnOpaque, "PixelsDrawnTranslucent", m_pixelsDrawnTranslucent); |
| 147 } | 147 } |
| 148 break; | 148 break; |
| 149 case UpdateAndCommit: | 149 case UpdateAndCommit: |
| 150 WebKit::Platform::current()->histogramCustomCounts("Renderer4.pixelCount
Painted", static_cast<int>(normalization * m_pixelsPainted), 100, 1000000, 50); | 150 WebKit::Platform::current()->histogramCustomCounts("Renderer4.pixelCount
Painted", static_cast<int>(normalization * m_pixelsPainted), 100, 1000000, 50); |
| 151 WebKit::Platform::current()->histogramCustomCounts("Renderer4.pixelCount
Opaque_Upload", static_cast<int>(normalization * m_pixelsUploadedOpaque), 100, 1
000000, 50); | 151 WebKit::Platform::current()->histogramCustomCounts("Renderer4.pixelCount
Opaque_Upload", static_cast<int>(normalization * m_pixelsUploadedOpaque), 100, 1
000000, 50); |
| 152 WebKit::Platform::current()->histogramCustomCounts("Renderer4.pixelCount
Translucent_Upload", static_cast<int>(normalization * m_pixelsUploadedTranslucen
t), 100, 1000000, 50); | 152 WebKit::Platform::current()->histogramCustomCounts("Renderer4.pixelCount
Translucent_Upload", static_cast<int>(normalization * m_pixelsUploadedTranslucen
t), 100, 1000000, 50); |
| 153 WebKit::Platform::current()->histogramCustomCounts("Renderer4.tileCountC
ulled_Upload", static_cast<int>(tileNormalization * m_tilesCulledForUpload), 100
, 10000000, 50); | 153 WebKit::Platform::current()->histogramCustomCounts("Renderer4.tileCountC
ulled_Upload", static_cast<int>(tileNormalization * m_tilesCulledForUpload), 100
, 10000000, 50); |
| 154 | 154 |
| 155 { | 155 { |
| 156 TRACE_COUNTER_ID1("webkit", "UploadTilesCulled", layerTreeHost, m_ti
lesCulledForUpload); | 156 TRACE_COUNTER_ID1("cc", "UploadTilesCulled", layerTreeHost, m_tilesC
ulledForUpload); |
| 157 TRACE_EVENT2("webkit", "CCOverdrawMetrics", "PixelsUploadedOpaque",
m_pixelsUploadedOpaque, "PixelsUploadedTranslucent", m_pixelsUploadedTranslucent
); | 157 TRACE_EVENT2("cc", "CCOverdrawMetrics", "PixelsUploadedOpaque", m_pi
xelsUploadedOpaque, "PixelsUploadedTranslucent", m_pixelsUploadedTranslucent); |
| 158 } | 158 } |
| 159 { | 159 { |
| 160 // This must be in a different scope than the TRACE_EVENT2 above. | 160 // This must be in a different scope than the TRACE_EVENT2 above. |
| 161 TRACE_EVENT1("webkit", "CCOverdrawPaintMetrics", "PixelsPainted", m_
pixelsPainted); | 161 TRACE_EVENT1("cc", "CCOverdrawPaintMetrics", "PixelsPainted", m_pixe
lsPainted); |
| 162 } | 162 } |
| 163 break; | 163 break; |
| 164 } | 164 } |
| 165 } | 165 } |
| 166 | 166 |
| 167 } // namespace WebCore | 167 } // namespace WebCore |
| 168 | 168 |
| 169 #endif | 169 #endif |
| OLD | NEW |