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

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

Issue 1463573002: publish canvas context API stat metrics (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 6
7 #include "platform/graphics/RecordingImageBufferSurface.h" 7 #include "platform/graphics/RecordingImageBufferSurface.h"
8 8
9 #include "platform/graphics/CanvasMetrics.h"
9 #include "platform/graphics/ExpensiveCanvasHeuristicParameters.h" 10 #include "platform/graphics/ExpensiveCanvasHeuristicParameters.h"
10 #include "platform/graphics/GraphicsContext.h" 11 #include "platform/graphics/GraphicsContext.h"
11 #include "platform/graphics/ImageBuffer.h" 12 #include "platform/graphics/ImageBuffer.h"
12 #include "public/platform/Platform.h" 13 #include "public/platform/Platform.h"
13 #include "third_party/skia/include/core/SkCanvas.h" 14 #include "third_party/skia/include/core/SkCanvas.h"
14 #include "third_party/skia/include/core/SkPictureRecorder.h" 15 #include "third_party/skia/include/core/SkPictureRecorder.h"
15 #include "wtf/PassOwnPtr.h" 16 #include "wtf/PassOwnPtr.h"
16 #include "wtf/PassRefPtr.h" 17 #include "wtf/PassRefPtr.h"
17 18
18 namespace blink { 19 namespace blink {
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 if (m_currentFrame) { 89 if (m_currentFrame) {
89 RefPtr<SkPicture> currentPicture = adoptRef(m_currentFrame->endRecording ()); 90 RefPtr<SkPicture> currentPicture = adoptRef(m_currentFrame->endRecording ());
90 currentPicture->playback(m_fallbackSurface->canvas()); 91 currentPicture->playback(m_fallbackSurface->canvas());
91 m_currentFrame.clear(); 92 m_currentFrame.clear();
92 } 93 }
93 94
94 if (m_imageBuffer) { 95 if (m_imageBuffer) {
95 m_imageBuffer->resetCanvas(m_fallbackSurface->canvas()); 96 m_imageBuffer->resetCanvas(m_fallbackSurface->canvas());
96 } 97 }
97 98
99 CanvasMetrics::countCanvasContextUsage(CanvasMetrics::DisplayList2DCanvasFal lbackToRaster);
98 } 100 }
99 101
100 PassRefPtr<SkImage> RecordingImageBufferSurface::newImageSnapshot(AccelerationHi nt hint) 102 PassRefPtr<SkImage> RecordingImageBufferSurface::newImageSnapshot(AccelerationHi nt hint)
101 { 103 {
102 if (!m_fallbackSurface) 104 if (!m_fallbackSurface)
103 fallBackToRasterCanvas(); 105 fallBackToRasterCanvas();
104 return m_fallbackSurface->newImageSnapshot(hint); 106 return m_fallbackSurface->newImageSnapshot(hint);
105 } 107 }
106 108
107 SkCanvas* RecordingImageBufferSurface::canvas() 109 SkCanvas* RecordingImageBufferSurface::canvas()
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 272
271 void RecordingImageBufferSurface::setIsHidden(bool hidden) 273 void RecordingImageBufferSurface::setIsHidden(bool hidden)
272 { 274 {
273 if (m_fallbackSurface) 275 if (m_fallbackSurface)
274 m_fallbackSurface->setIsHidden(hidden); 276 m_fallbackSurface->setIsHidden(hidden);
275 else 277 else
276 ImageBufferSurface::setIsHidden(hidden); 278 ImageBufferSurface::setIsHidden(hidden);
277 } 279 }
278 280
279 } // namespace blink 281 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/CanvasMetrics.cpp ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698