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

Unified Diff: cc/bitmap_canvas_layer_texture_updater.cc

Issue 11074009: cc: Remove LayerTextureUpdater::Texture::updateRect() callback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. 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/bitmap_canvas_layer_texture_updater.h ('k') | cc/bitmap_skpicture_canvas_layer_texture_updater.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/bitmap_canvas_layer_texture_updater.cc
diff --git a/cc/bitmap_canvas_layer_texture_updater.cc b/cc/bitmap_canvas_layer_texture_updater.cc
index 3231b7d84a9e30173e23d3f9b5cb46b06f2826ac..a83c77b223a6f62d02004206760675e1871526e2 100644
--- a/cc/bitmap_canvas_layer_texture_updater.cc
+++ b/cc/bitmap_canvas_layer_texture_updater.cc
@@ -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)
« no previous file with comments | « cc/bitmap_canvas_layer_texture_updater.h ('k') | cc/bitmap_skpicture_canvas_layer_texture_updater.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698