OLD | NEW |
1 // Copyright 2010 The Chromium Authors. All rights reserved. | 1 // Copyright 2010 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 "cc/content_layer.h" | 5 #include "cc/content_layer.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/time.h" | 10 #include "base/time.h" |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 return; | 97 return; |
98 scoped_ptr<LayerPainter> painter = ContentLayerPainter::create(m_client).Pas
sAs<LayerPainter>(); | 98 scoped_ptr<LayerPainter> painter = ContentLayerPainter::create(m_client).Pas
sAs<LayerPainter>(); |
99 if (layerTreeHost()->settings().acceleratePainting) | 99 if (layerTreeHost()->settings().acceleratePainting) |
100 m_updater = SkPictureContentLayerUpdater::create(painter.Pass()); | 100 m_updater = SkPictureContentLayerUpdater::create(painter.Pass()); |
101 else if (layerTreeHost()->settings().perTilePaintingEnabled) | 101 else if (layerTreeHost()->settings().perTilePaintingEnabled) |
102 m_updater = BitmapSkPictureContentLayerUpdater::create(painter.Pass()); | 102 m_updater = BitmapSkPictureContentLayerUpdater::create(painter.Pass()); |
103 else | 103 else |
104 m_updater = BitmapContentLayerUpdater::create(painter.Pass()); | 104 m_updater = BitmapContentLayerUpdater::create(painter.Pass()); |
105 m_updater->setOpaque(contentsOpaque()); | 105 m_updater->setOpaque(contentsOpaque()); |
106 | 106 |
107 GLenum textureFormat = layerTreeHost()->rendererCapabilities().bestTextureFo
rmat; | 107 unsigned textureFormat = layerTreeHost()->rendererCapabilities().bestTexture
Format; |
108 setTextureFormat(textureFormat); | 108 setTextureFormat(textureFormat); |
109 } | 109 } |
110 | 110 |
111 void ContentLayer::setContentsOpaque(bool opaque) | 111 void ContentLayer::setContentsOpaque(bool opaque) |
112 { | 112 { |
113 Layer::setContentsOpaque(opaque); | 113 Layer::setContentsOpaque(opaque); |
114 if (m_updater) | 114 if (m_updater) |
115 m_updater->setOpaque(opaque); | 115 m_updater->setOpaque(opaque); |
116 } | 116 } |
117 | 117 |
(...skipping 25 matching lines...) Expand all Loading... |
143 // it does not really cause any invalidation. | 143 // it does not really cause any invalidation. |
144 TRACE_EVENT_INSTANT0("cc", "ContentLayer::canUseLCDTextDidChange"); | 144 TRACE_EVENT_INSTANT0("cc", "ContentLayer::canUseLCDTextDidChange"); |
145 } | 145 } |
146 ++m_lcdTextChangeCount; | 146 ++m_lcdTextChangeCount; |
147 | 147 |
148 // Need to repaint the layer with different text AA setting. | 148 // Need to repaint the layer with different text AA setting. |
149 setNeedsDisplay(); | 149 setNeedsDisplay(); |
150 } | 150 } |
151 | 151 |
152 } // namespace cc | 152 } // namespace cc |
OLD | NEW |