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

Side by Side Diff: Source/platform/graphics/GraphicsLayer.cpp

Issue 183103007: Implement will-change-based GPU rasterization hint (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Move hint from WebLayer to WebContentLayer Created 6 years, 9 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
« no previous file with comments | « Source/platform/graphics/GraphicsLayer.h ('k') | Source/web/WebSettingsImpl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 Apple 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 , m_opacity(1) 82 , m_opacity(1)
83 , m_zPosition(0) 83 , m_zPosition(0)
84 , m_blendMode(blink::WebBlendModeNormal) 84 , m_blendMode(blink::WebBlendModeNormal)
85 , m_contentsOpaque(false) 85 , m_contentsOpaque(false)
86 , m_shouldFlattenTransform(true) 86 , m_shouldFlattenTransform(true)
87 , m_backfaceVisibility(true) 87 , m_backfaceVisibility(true)
88 , m_masksToBounds(false) 88 , m_masksToBounds(false)
89 , m_drawsContent(false) 89 , m_drawsContent(false)
90 , m_contentsVisible(true) 90 , m_contentsVisible(true)
91 , m_isRootForIsolatedGroup(false) 91 , m_isRootForIsolatedGroup(false)
92 , m_hasGpuRasterizationHint(false)
92 , m_hasScrollParent(false) 93 , m_hasScrollParent(false)
93 , m_hasClipParent(false) 94 , m_hasClipParent(false)
94 , m_paintingPhase(GraphicsLayerPaintAllWithOverflowClip) 95 , m_paintingPhase(GraphicsLayerPaintAllWithOverflowClip)
95 , m_contentsOrientation(CompositingCoordinatesTopDown) 96 , m_contentsOrientation(CompositingCoordinatesTopDown)
96 , m_parent(0) 97 , m_parent(0)
97 , m_maskLayer(0) 98 , m_maskLayer(0)
98 , m_contentsClippingMaskLayer(0) 99 , m_contentsClippingMaskLayer(0)
99 , m_replicaLayer(0) 100 , m_replicaLayer(0)
100 , m_replicatedLayer(0) 101 , m_replicatedLayer(0)
101 , m_paintCount(0) 102 , m_paintCount(0)
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after
600 if (m_drawsContent) { 601 if (m_drawsContent) {
601 writeIndent(ts, indent + 1); 602 writeIndent(ts, indent + 1);
602 ts << "(drawsContent " << m_drawsContent << ")\n"; 603 ts << "(drawsContent " << m_drawsContent << ")\n";
603 } 604 }
604 605
605 if (!m_contentsVisible) { 606 if (!m_contentsVisible) {
606 writeIndent(ts, indent + 1); 607 writeIndent(ts, indent + 1);
607 ts << "(contentsVisible " << m_contentsVisible << ")\n"; 608 ts << "(contentsVisible " << m_contentsVisible << ")\n";
608 } 609 }
609 610
611 if (m_hasGpuRasterizationHint) {
612 writeIndent(ts, indent + 1);
613 ts << "(hasGpuRasterizationHint " << m_hasGpuRasterizationHint << ")\n";
614 }
615
610 if (!m_backfaceVisibility) { 616 if (!m_backfaceVisibility) {
611 writeIndent(ts, indent + 1); 617 writeIndent(ts, indent + 1);
612 ts << "(backfaceVisibility " << (m_backfaceVisibility ? "visible" : "hid den") << ")\n"; 618 ts << "(backfaceVisibility " << (m_backfaceVisibility ? "visible" : "hid den") << ")\n";
613 } 619 }
614 620
615 if (flags & LayerTreeIncludesDebugInfo) { 621 if (flags & LayerTreeIncludesDebugInfo) {
616 writeIndent(ts, indent + 1); 622 writeIndent(ts, indent + 1);
617 ts << "("; 623 ts << "(";
618 if (m_client) 624 if (m_client)
619 ts << "client " << static_cast<void*>(m_client); 625 ts << "client " << static_cast<void*>(m_client);
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
939 } 945 }
940 946
941 void GraphicsLayer::setIsRootForIsolatedGroup(bool isolated) 947 void GraphicsLayer::setIsRootForIsolatedGroup(bool isolated)
942 { 948 {
943 if (m_isRootForIsolatedGroup == isolated) 949 if (m_isRootForIsolatedGroup == isolated)
944 return; 950 return;
945 m_isRootForIsolatedGroup = isolated; 951 m_isRootForIsolatedGroup = isolated;
946 platformLayer()->setIsRootForIsolatedGroup(isolated); 952 platformLayer()->setIsRootForIsolatedGroup(isolated);
947 } 953 }
948 954
955 void GraphicsLayer::setHasGpuRasterizationHint(bool hasHint)
956 {
957 m_hasGpuRasterizationHint = hasHint;
958 m_layer->setHasGpuRasterizationHint(hasHint);
959 }
960
949 void GraphicsLayer::setContentsNeedsDisplay() 961 void GraphicsLayer::setContentsNeedsDisplay()
950 { 962 {
951 if (WebLayer* contentsLayer = contentsLayerIfRegistered()) { 963 if (WebLayer* contentsLayer = contentsLayerIfRegistered()) {
952 contentsLayer->invalidate(); 964 contentsLayer->invalidate();
953 addRepaintRect(contentsRect()); 965 addRepaintRect(contentsRect());
954 } 966 }
955 } 967 }
956 968
957 void GraphicsLayer::setNeedsDisplay() 969 void GraphicsLayer::setNeedsDisplay()
958 { 970 {
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
1204 #ifndef NDEBUG 1216 #ifndef NDEBUG
1205 void showGraphicsLayerTree(const WebCore::GraphicsLayer* layer) 1217 void showGraphicsLayerTree(const WebCore::GraphicsLayer* layer)
1206 { 1218 {
1207 if (!layer) 1219 if (!layer)
1208 return; 1220 return;
1209 1221
1210 String output = layer->layerTreeAsText(WebCore::LayerTreeIncludesDebugInfo); 1222 String output = layer->layerTreeAsText(WebCore::LayerTreeIncludesDebugInfo);
1211 fprintf(stderr, "%s\n", output.utf8().data()); 1223 fprintf(stderr, "%s\n", output.utf8().data());
1212 } 1224 }
1213 #endif 1225 #endif
OLDNEW
« no previous file with comments | « Source/platform/graphics/GraphicsLayer.h ('k') | Source/web/WebSettingsImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698