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

Unified Diff: cc/BitmapSkPictureCanvasLayerTextureUpdater.cpp

Issue 11122003: [cc] Rename all cc/ filenames to Chromium style (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/BitmapSkPictureCanvasLayerTextureUpdater.h ('k') | cc/CCActiveAnimation.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/BitmapSkPictureCanvasLayerTextureUpdater.cpp
diff --git a/cc/BitmapSkPictureCanvasLayerTextureUpdater.cpp b/cc/BitmapSkPictureCanvasLayerTextureUpdater.cpp
deleted file mode 100644
index 93c8483a11f07fa6243b3cc7bf35ab6d139e3e50..0000000000000000000000000000000000000000
--- a/cc/BitmapSkPictureCanvasLayerTextureUpdater.cpp
+++ /dev/null
@@ -1,84 +0,0 @@
-// Copyright 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-
-#include "config.h"
-
-#if USE(ACCELERATED_COMPOSITING)
-
-#include "BitmapSkPictureCanvasLayerTextureUpdater.h"
-
-#include "CCRenderingStats.h"
-#include "LayerPainterChromium.h"
-#include "PlatformColor.h"
-#include "SkCanvas.h"
-#include "SkDevice.h"
-#include <wtf/CurrentTime.h>
-
-namespace cc {
-
-BitmapSkPictureCanvasLayerTextureUpdater::Texture::Texture(BitmapSkPictureCanvasLayerTextureUpdater* textureUpdater, scoped_ptr<CCPrioritizedTexture> texture)
- : CanvasLayerTextureUpdater::Texture(texture.Pass())
- , m_textureUpdater(textureUpdater)
-{
-}
-
-void BitmapSkPictureCanvasLayerTextureUpdater::Texture::prepareRect(const IntRect& sourceRect, CCRenderingStats& stats)
-{
- m_bitmap.setConfig(SkBitmap::kARGB_8888_Config, sourceRect.width(), sourceRect.height());
- m_bitmap.allocPixels();
- m_bitmap.setIsOpaque(m_textureUpdater->layerIsOpaque());
- SkDevice device(m_bitmap);
- SkCanvas canvas(&device);
- double paintBeginTime = monotonicallyIncreasingTime();
- textureUpdater()->paintContentsRect(&canvas, sourceRect, stats);
- stats.totalPaintTimeInSeconds += monotonicallyIncreasingTime() - paintBeginTime;
-}
-
-void BitmapSkPictureCanvasLayerTextureUpdater::Texture::updateRect(CCResourceProvider* resourceProvider, const IntRect& sourceRect, const IntSize& destOffset)
-{
- m_bitmap.lockPixels();
- texture()->upload(resourceProvider, static_cast<uint8_t*>(m_bitmap.getPixels()), sourceRect, sourceRect, destOffset);
- m_bitmap.unlockPixels();
- m_bitmap.reset();
-}
-
-PassRefPtr<BitmapSkPictureCanvasLayerTextureUpdater> BitmapSkPictureCanvasLayerTextureUpdater::create(PassOwnPtr<LayerPainterChromium> painter)
-{
- return adoptRef(new BitmapSkPictureCanvasLayerTextureUpdater(painter));
-}
-
-BitmapSkPictureCanvasLayerTextureUpdater::BitmapSkPictureCanvasLayerTextureUpdater(PassOwnPtr<LayerPainterChromium> painter)
- : SkPictureCanvasLayerTextureUpdater(painter)
-{
-}
-
-BitmapSkPictureCanvasLayerTextureUpdater::~BitmapSkPictureCanvasLayerTextureUpdater()
-{
-}
-
-PassOwnPtr<LayerTextureUpdater::Texture> BitmapSkPictureCanvasLayerTextureUpdater::createTexture(CCPrioritizedTextureManager* manager)
-{
- return adoptPtr(new Texture(this, CCPrioritizedTexture::create(manager)));
-}
-
-LayerTextureUpdater::SampledTexelFormat BitmapSkPictureCanvasLayerTextureUpdater::sampledTexelFormat(GC3Denum textureFormat)
-{
- // The component order may be bgra if we uploaded bgra pixels to rgba textures.
- return PlatformColor::sameComponentOrder(textureFormat) ?
- LayerTextureUpdater::SampledTexelFormatRGBA : LayerTextureUpdater::SampledTexelFormatBGRA;
-}
-
-void BitmapSkPictureCanvasLayerTextureUpdater::paintContentsRect(SkCanvas* canvas, const IntRect& sourceRect, CCRenderingStats& stats)
-{
- // Translate the origin of contentRect to that of sourceRect.
- canvas->translate(contentRect().x() - sourceRect.x(),
- contentRect().y() - sourceRect.y());
- double rasterizeBeginTime = monotonicallyIncreasingTime();
- drawPicture(canvas);
- stats.totalRasterizeTimeInSeconds += monotonicallyIncreasingTime() - rasterizeBeginTime;
-}
-
-} // namespace cc
-#endif // USE(ACCELERATED_COMPOSITING)
« no previous file with comments | « cc/BitmapSkPictureCanvasLayerTextureUpdater.h ('k') | cc/CCActiveAnimation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698