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

Side by Side Diff: Source/platform/graphics/paint/CachedDisplayItem.cpp

Issue 847783003: New display item caching (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: New method, supporting partial paint Created 5 years, 11 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
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "config.h"
6 #include "platform/graphics/paint/CachedDisplayItem.h"
7
8 #include "platform/graphics/GraphicsContext.h"
9 #include "public/platform/WebDisplayItemList.h"
10 #include "third_party/skia/include/core/SkPicture.h"
11
12 namespace blink {
13
14 #ifndef NDEBUG
15
16 static void drawRedRect(GraphicsContext& context, const FloatRect& bounds)
17 {
18 SkPaint paint;
19 paint.setColor(SK_ColorRED);
Stephen Chennney 2015/01/27 19:45:45 bikeshed: Red is probably OK, but better is someth
trchen 2015/01/27 19:52:01 I would vote for red for the sake of consistency,
20 context.drawRect(bounds, paint);
21 }
22
23 void CachedDisplayItem::replay(GraphicsContext* context)
24 {
25 drawRedRect(*context, m_bounds);
26 }
27
28 void CachedDisplayItem::appendToWebDisplayItemList(WebDisplayItemList* list) con st
29 {
30 GraphicsContext context(nullptr, nullptr);
31 context.beginRecording(m_bounds);
32 drawRedRect(context, m_bounds);
33 RefPtr<const SkPicture> picture = context.endRecording();
34 list->appendDrawingItem(const_cast<SkPicture*>(picture.get()), FloatPoint()) ;
35 }
36
37 #endif // ifndef NDEBUG
38
39 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/graphics/paint/CachedDisplayItem.h ('k') | Source/platform/graphics/paint/DisplayItem.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698