| 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 "config.h" | 5 #include "config.h" | 
| 6 | 6 | 
| 7 #include "cc/content_layer.h" | 7 #include "cc/content_layer.h" | 
| 8 | 8 | 
| 9 #include "CCLayerTreeHost.h" | 9 #include "CCLayerTreeHost.h" | 
| 10 #include "CCSettings.h" | 10 #include "CCSettings.h" | 
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 83     return m_textureUpdater.get(); | 83     return m_textureUpdater.get(); | 
| 84 } | 84 } | 
| 85 | 85 | 
| 86 void ContentLayerChromium::createTextureUpdaterIfNeeded() | 86 void ContentLayerChromium::createTextureUpdaterIfNeeded() | 
| 87 { | 87 { | 
| 88     if (m_textureUpdater) | 88     if (m_textureUpdater) | 
| 89         return; | 89         return; | 
| 90     scoped_ptr<LayerPainterChromium> painter = ContentLayerPainter::create(m_cli
     ent).PassAs<LayerPainterChromium>(); | 90     scoped_ptr<LayerPainterChromium> painter = ContentLayerPainter::create(m_cli
     ent).PassAs<LayerPainterChromium>(); | 
| 91     if (layerTreeHost()->settings().acceleratePainting) | 91     if (layerTreeHost()->settings().acceleratePainting) | 
| 92         m_textureUpdater = FrameBufferSkPictureCanvasLayerTextureUpdater::create
     (painter.Pass()); | 92         m_textureUpdater = FrameBufferSkPictureCanvasLayerTextureUpdater::create
     (painter.Pass()); | 
| 93     else if (CCSettings::perTilePaintingEnabled()) | 93     else if (Settings::perTilePaintingEnabled()) | 
| 94         m_textureUpdater = BitmapSkPictureCanvasLayerTextureUpdater::create(pain
     ter.Pass()); | 94         m_textureUpdater = BitmapSkPictureCanvasLayerTextureUpdater::create(pain
     ter.Pass()); | 
| 95     else | 95     else | 
| 96         m_textureUpdater = BitmapCanvasLayerTextureUpdater::create(painter.Pass(
     )); | 96         m_textureUpdater = BitmapCanvasLayerTextureUpdater::create(painter.Pass(
     )); | 
| 97     m_textureUpdater->setOpaque(contentsOpaque()); | 97     m_textureUpdater->setOpaque(contentsOpaque()); | 
| 98 | 98 | 
| 99     GC3Denum textureFormat = layerTreeHost()->rendererCapabilities().bestTexture
     Format; | 99     GC3Denum textureFormat = layerTreeHost()->rendererCapabilities().bestTexture
     Format; | 
| 100     setTextureFormat(textureFormat); | 100     setTextureFormat(textureFormat); | 
| 101     setSampledTexelFormat(textureUpdater()->sampledTexelFormat(textureFormat)); | 101     setSampledTexelFormat(textureUpdater()->sampledTexelFormat(textureFormat)); | 
| 102 } | 102 } | 
| 103 | 103 | 
| 104 void ContentLayerChromium::setContentsOpaque(bool opaque) | 104 void ContentLayerChromium::setContentsOpaque(bool opaque) | 
| 105 { | 105 { | 
| 106     LayerChromium::setContentsOpaque(opaque); | 106     LayerChromium::setContentsOpaque(opaque); | 
| 107     if (m_textureUpdater) | 107     if (m_textureUpdater) | 
| 108         m_textureUpdater->setOpaque(opaque); | 108         m_textureUpdater->setOpaque(opaque); | 
| 109 } | 109 } | 
| 110 | 110 | 
| 111 } | 111 } | 
| OLD | NEW | 
|---|