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

Unified Diff: cc/BitmapCanvasLayerTextureUpdater.cpp

Issue 11074009: cc: Remove LayerTextureUpdater::Texture::updateRect() callback. (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
Index: cc/BitmapCanvasLayerTextureUpdater.cpp
diff --git a/cc/BitmapCanvasLayerTextureUpdater.cpp b/cc/BitmapCanvasLayerTextureUpdater.cpp
index 35fb5a0eb3026e44db35f99f64045cfdaeae0995..0a582cf47929c92342d0e1bd2c27537306707939 100644
--- a/cc/BitmapCanvasLayerTextureUpdater.cpp
+++ b/cc/BitmapCanvasLayerTextureUpdater.cpp
@@ -9,6 +9,7 @@
#include "BitmapCanvasLayerTextureUpdater.h"
+#include "CCTextureUpdateQueue.h"
#include "LayerPainterChromium.h"
#include "PlatformColor.h"
#include "skia/ext/platform_canvas.h"
@@ -25,9 +26,9 @@ BitmapCanvasLayerTextureUpdater::Texture::~Texture()
{
}
-void BitmapCanvasLayerTextureUpdater::Texture::updateRect(CCResourceProvider* resourceProvider, const IntRect& sourceRect, const IntSize& destOffset)
+void BitmapCanvasLayerTextureUpdater::Texture::update(CCTextureUpdateQueue& queue, const IntRect& sourceRect, const IntSize& destOffset, bool partialUpdate, CCRenderingStats&)
{
- textureUpdater()->updateTextureRect(resourceProvider, texture(), sourceRect, destOffset);
+ textureUpdater()->updateTexture(queue, texture(), sourceRect, destOffset, partialUpdate);
}
PassRefPtr<BitmapCanvasLayerTextureUpdater> BitmapCanvasLayerTextureUpdater::create(PassOwnPtr<LayerPainterChromium> painter)
@@ -67,13 +68,13 @@ void BitmapCanvasLayerTextureUpdater::prepareToUpdate(const IntRect& contentRect
paintContents(m_canvas.get(), contentRect, contentsWidthScale, contentsHeightScale, resultingOpaqueRect, stats);
}
-void BitmapCanvasLayerTextureUpdater::updateTextureRect(CCResourceProvider* resourceProvider, CCPrioritizedTexture* texture, const IntRect& sourceRect, const IntSize& destOffset)
+void BitmapCanvasLayerTextureUpdater::updateTexture(CCTextureUpdateQueue& queue, CCPrioritizedTexture* texture, const IntRect& sourceRect, const IntSize& destOffset, bool partialUpdate)
{
- const SkBitmap& bitmap = m_canvas->getDevice()->accessBitmap(false);
- bitmap.lockPixels();
-
- texture->upload(resourceProvider, static_cast<const uint8_t*>(bitmap.getPixels()), contentRect(), sourceRect, destOffset);
- bitmap.unlockPixels();
+ TextureUploader::Parameters upload = { texture, &m_canvas->getDevice()->accessBitmap(false), NULL, { contentRect(), sourceRect, destOffset } };
+ if (partialUpdate)
+ queue.appendPartialUpload(upload);
+ else
+ queue.appendFullUpload(upload);
}
void BitmapCanvasLayerTextureUpdater::setOpaque(bool opaque)

Powered by Google App Engine
This is Rietveld 408576698