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

Side by Side Diff: third_party/WebKit/Source/core/paint/FramePaintTiming.h

Issue 2872793002: Notify paint for each frame (Closed)
Patch Set: review fix Created 3 years, 7 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
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
Xianzhu 2017/05/10 23:22:46 Please list this file in Source/core/paint/BUILD.g
Zhen Wang 2017/05/11 20:27:08 Done.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef FramePaintTiming_h
6 #define FramePaintTiming_h
7
8 #include "core/frame/LocalFrame.h"
9 #include "core/paint/PaintTiming.h"
10 #include "platform/graphics/GraphicsContext.h"
11 #include "platform/graphics/paint/PaintController.h"
12 #include "platform/heap/Handle.h"
13
14 namespace blink {
15
16 class FramePaintTiming {
17 STACK_ALLOCATED();
18 WTF_MAKE_NONCOPYABLE(FramePaintTiming);
19
20 public:
21 FramePaintTiming(GraphicsContext& context, const LocalFrame* frame)
22 : context_(context), frame_(frame) {
23 context_.GetPaintController().BeginFrame(frame_);
24 }
25
26 ~FramePaintTiming() {
27 DCHECK(frame_->GetDocument());
28 FrameFirstPaint result = context_.GetPaintController().EndFrame(frame_);
29 PaintTiming::From(*frame_->GetDocument())
30 .NotifyPaint(result.first_painted, result.text_painted,
31 result.image_painted);
32 }
33
34 private:
35 GraphicsContext& context_;
36 Member<const LocalFrame> frame_;
37 };
38
39 } // namespace blink
40
41 #endif // FramePaintTiming_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698