| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 | 5 |
| 6 #include "config.h" | 6 #include "config.h" |
| 7 | 7 |
| 8 #if USE(ACCELERATED_COMPOSITING) | 8 #if USE(ACCELERATED_COMPOSITING) |
| 9 | 9 |
| 10 #include "BitmapSkPictureCanvasLayerTextureUpdater.h" | 10 #include "BitmapSkPictureCanvasLayerTextureUpdater.h" |
| 11 | 11 |
| 12 #include "CCRenderingStats.h" | 12 #include "CCRenderingStats.h" |
| 13 #include "LayerPainterChromium.h" | 13 #include "LayerPainterChromium.h" |
| 14 #include "PlatformColor.h" | 14 #include "PlatformColor.h" |
| 15 #include "SkCanvas.h" | 15 #include "SkCanvas.h" |
| 16 #include "SkDevice.h" | 16 #include "SkDevice.h" |
| 17 #include <wtf/CurrentTime.h> | 17 #include <wtf/CurrentTime.h> |
| 18 | 18 |
| 19 namespace WebCore { | 19 namespace cc { |
| 20 | 20 |
| 21 BitmapSkPictureCanvasLayerTextureUpdater::Texture::Texture(BitmapSkPictureCanvas
LayerTextureUpdater* textureUpdater, PassOwnPtr<CCPrioritizedTexture> texture) | 21 BitmapSkPictureCanvasLayerTextureUpdater::Texture::Texture(BitmapSkPictureCanvas
LayerTextureUpdater* textureUpdater, PassOwnPtr<CCPrioritizedTexture> texture) |
| 22 : CanvasLayerTextureUpdater::Texture(texture) | 22 : CanvasLayerTextureUpdater::Texture(texture) |
| 23 , m_textureUpdater(textureUpdater) | 23 , m_textureUpdater(textureUpdater) |
| 24 { | 24 { |
| 25 } | 25 } |
| 26 | 26 |
| 27 void BitmapSkPictureCanvasLayerTextureUpdater::Texture::prepareRect(const IntRec
t& sourceRect, CCRenderingStats& stats) | 27 void BitmapSkPictureCanvasLayerTextureUpdater::Texture::prepareRect(const IntRec
t& sourceRect, CCRenderingStats& stats) |
| 28 { | 28 { |
| 29 m_bitmap.setConfig(SkBitmap::kARGB_8888_Config, sourceRect.width(), sourceRe
ct.height()); | 29 m_bitmap.setConfig(SkBitmap::kARGB_8888_Config, sourceRect.width(), sourceRe
ct.height()); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 void BitmapSkPictureCanvasLayerTextureUpdater::paintContentsRect(SkCanvas* canva
s, const IntRect& sourceRect, CCRenderingStats& stats) | 73 void BitmapSkPictureCanvasLayerTextureUpdater::paintContentsRect(SkCanvas* canva
s, const IntRect& sourceRect, CCRenderingStats& stats) |
| 74 { | 74 { |
| 75 // Translate the origin of contentRect to that of sourceRect. | 75 // Translate the origin of contentRect to that of sourceRect. |
| 76 canvas->translate(contentRect().x() - sourceRect.x(), | 76 canvas->translate(contentRect().x() - sourceRect.x(), |
| 77 contentRect().y() - sourceRect.y()); | 77 contentRect().y() - sourceRect.y()); |
| 78 double rasterizeBeginTime = monotonicallyIncreasingTime(); | 78 double rasterizeBeginTime = monotonicallyIncreasingTime(); |
| 79 drawPicture(canvas); | 79 drawPicture(canvas); |
| 80 stats.totalRasterizeTimeInSeconds += monotonicallyIncreasingTime() - rasteri
zeBeginTime; | 80 stats.totalRasterizeTimeInSeconds += monotonicallyIncreasingTime() - rasteri
zeBeginTime; |
| 81 } | 81 } |
| 82 | 82 |
| 83 } // namespace WebCore | 83 } // namespace cc |
| 84 #endif // USE(ACCELERATED_COMPOSITING) | 84 #endif // USE(ACCELERATED_COMPOSITING) |
| OLD | NEW |