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

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

Issue 784453003: Initial scroll-blocks-on compositor integration (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Eliminate scrollbars from iframe test for cross-platform output consistency 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
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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 PassOwnPtr<GraphicsLayer> GraphicsLayer::create(GraphicsLayerFactory* factory, G raphicsLayerClient* client) 73 PassOwnPtr<GraphicsLayer> GraphicsLayer::create(GraphicsLayerFactory* factory, G raphicsLayerClient* client)
74 { 74 {
75 return factory->createGraphicsLayer(client); 75 return factory->createGraphicsLayer(client);
76 } 76 }
77 77
78 GraphicsLayer::GraphicsLayer(GraphicsLayerClient* client) 78 GraphicsLayer::GraphicsLayer(GraphicsLayerClient* client)
79 : m_client(client) 79 : m_client(client)
80 , m_backgroundColor(Color::transparent) 80 , m_backgroundColor(Color::transparent)
81 , m_opacity(1) 81 , m_opacity(1)
82 , m_blendMode(WebBlendModeNormal) 82 , m_blendMode(WebBlendModeNormal)
83 , m_scrollBlocksOn(WebScrollBlocksOnNone)
83 , m_hasTransformOrigin(false) 84 , m_hasTransformOrigin(false)
84 , m_contentsOpaque(false) 85 , m_contentsOpaque(false)
85 , m_shouldFlattenTransform(true) 86 , m_shouldFlattenTransform(true)
86 , m_backfaceVisibility(true) 87 , m_backfaceVisibility(true)
87 , m_masksToBounds(false) 88 , m_masksToBounds(false)
88 , m_drawsContent(false) 89 , m_drawsContent(false)
89 , m_contentsVisible(true) 90 , m_contentsVisible(true)
90 , m_isRootForIsolatedGroup(false) 91 , m_isRootForIsolatedGroup(false)
91 , m_hasScrollParent(false) 92 , m_hasScrollParent(false)
92 , m_hasClipParent(false) 93 , m_hasClipParent(false)
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after
567 568
568 if (m_size != IntSize()) 569 if (m_size != IntSize())
569 json->setArray("bounds", sizeAsJSONArray(m_size)); 570 json->setArray("bounds", sizeAsJSONArray(m_size));
570 571
571 if (m_opacity != 1) 572 if (m_opacity != 1)
572 json->setNumber("opacity", m_opacity); 573 json->setNumber("opacity", m_opacity);
573 574
574 if (m_blendMode != WebBlendModeNormal) 575 if (m_blendMode != WebBlendModeNormal)
575 json->setString("blendMode", compositeOperatorName(CompositeSourceOver, m_blendMode)); 576 json->setString("blendMode", compositeOperatorName(CompositeSourceOver, m_blendMode));
576 577
578 if ((flags & LayerTreeIncludesScrollBlocksOn) && m_scrollBlocksOn) {
579 RefPtr<JSONArray> scrollBlocksOnJSON = adoptRef(new JSONArray);
580 if (m_scrollBlocksOn & WebScrollBlocksOnStartTouch)
581 scrollBlocksOnJSON->pushString("StartTouch");
582 if (m_scrollBlocksOn & WebScrollBlocksOnWheelEvent)
583 scrollBlocksOnJSON->pushString("WheelEvent");
584 if (m_scrollBlocksOn & WebScrollBlocksOnScrollEvent)
585 scrollBlocksOnJSON->pushString("ScrollEvent");
586 json->setArray("scrollBlocksOn", scrollBlocksOnJSON);
587 }
588
577 if (m_isRootForIsolatedGroup) 589 if (m_isRootForIsolatedGroup)
578 json->setBoolean("isolate", m_isRootForIsolatedGroup); 590 json->setBoolean("isolate", m_isRootForIsolatedGroup);
579 591
580 if (m_contentsOpaque) 592 if (m_contentsOpaque)
581 json->setBoolean("contentsOpaque", m_contentsOpaque); 593 json->setBoolean("contentsOpaque", m_contentsOpaque);
582 594
583 if (!m_shouldFlattenTransform) 595 if (!m_shouldFlattenTransform)
584 json->setBoolean("shouldFlattenTransform", m_shouldFlattenTransform); 596 json->setBoolean("shouldFlattenTransform", m_shouldFlattenTransform);
585 597
586 if (m_3dRenderingContext) { 598 if (m_3dRenderingContext) {
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
869 float clampedOpacity = std::max(std::min(opacity, 1.0f), 0.0f); 881 float clampedOpacity = std::max(std::min(opacity, 1.0f), 0.0f);
870 m_opacity = clampedOpacity; 882 m_opacity = clampedOpacity;
871 platformLayer()->setOpacity(opacity); 883 platformLayer()->setOpacity(opacity);
872 } 884 }
873 885
874 void GraphicsLayer::setBlendMode(WebBlendMode blendMode) 886 void GraphicsLayer::setBlendMode(WebBlendMode blendMode)
875 { 887 {
876 if (m_blendMode == blendMode) 888 if (m_blendMode == blendMode)
877 return; 889 return;
878 m_blendMode = blendMode; 890 m_blendMode = blendMode;
879 platformLayer()->setBlendMode(WebBlendMode(blendMode)); 891 platformLayer()->setBlendMode(blendMode);
892 }
893
894 void GraphicsLayer::setScrollBlocksOn(WebScrollBlocksOn scrollBlocksOn)
895 {
896 if (m_scrollBlocksOn == scrollBlocksOn)
897 return;
898 m_scrollBlocksOn = scrollBlocksOn;
899 platformLayer()->setScrollBlocksOn(scrollBlocksOn);
880 } 900 }
881 901
882 void GraphicsLayer::setIsRootForIsolatedGroup(bool isolated) 902 void GraphicsLayer::setIsRootForIsolatedGroup(bool isolated)
883 { 903 {
884 if (m_isRootForIsolatedGroup == isolated) 904 if (m_isRootForIsolatedGroup == isolated)
885 return; 905 return;
886 m_isRootForIsolatedGroup = isolated; 906 m_isRootForIsolatedGroup = isolated;
887 platformLayer()->setIsRootForIsolatedGroup(isolated); 907 platformLayer()->setIsRootForIsolatedGroup(isolated);
888 } 908 }
889 909
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
1092 #ifndef NDEBUG 1112 #ifndef NDEBUG
1093 void showGraphicsLayerTree(const blink::GraphicsLayer* layer) 1113 void showGraphicsLayerTree(const blink::GraphicsLayer* layer)
1094 { 1114 {
1095 if (!layer) 1115 if (!layer)
1096 return; 1116 return;
1097 1117
1098 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); 1118 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo);
1099 fprintf(stderr, "%s\n", output.utf8().data()); 1119 fprintf(stderr, "%s\n", output.utf8().data());
1100 } 1120 }
1101 #endif 1121 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698