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

Unified Diff: cc/caching_bitmap_canvas_layer_texture_updater.h

Issue 11044003: Reduce texture uploads during scrollbar invalidations. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments. 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/caching_bitmap_canvas_layer_texture_updater.h
diff --git a/cc/caching_bitmap_canvas_layer_texture_updater.h b/cc/caching_bitmap_canvas_layer_texture_updater.h
new file mode 100644
index 0000000000000000000000000000000000000000..8569447a2f22643fb74c9bf71ae784cfe8d8ce46
--- /dev/null
+++ b/cc/caching_bitmap_canvas_layer_texture_updater.h
@@ -0,0 +1,41 @@
+// Copyright 2012 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.
+
+#ifndef CACHING_BITMAP_CANVAS_LAYER_TEXTURE_UPDATER_H_
tfarina 2012/10/02 21:58:29 CC_CACHING_BITMAP_CANVAS_LAYER_TEXTURE_UPDATER_H_
+#define CACHING_BITMAP_CANVAS_LAYER_TEXTURE_UPDATER_H_
+
+#include "base/compiler_specific.h"
+#include "BitmapCanvasLayerTextureUpdater.h"
+
+namespace cc {
+
+class CachingBitmapCanvasLayerTextureUpdater
+ : public BitmapCanvasLayerTextureUpdater {
+ public:
+ static PassRefPtr<CachingBitmapCanvasLayerTextureUpdater> Create(
+ PassOwnPtr<LayerPainterChromium>);
+
+ virtual void prepareToUpdate(const IntRect& content_rect,
+ const IntSize& tile_size,
+ float contents_width_scale,
+ float contents_height_scale,
+ IntRect& resulting_opaque_rect,
+ CCRenderingStats&) OVERRIDE;
+
+ virtual void updateTextureRect(CCResourceProvider*,
+ CCPrioritizedTexture*,
+ const IntRect& source_rect,
+ const IntSize& dest_offset) OVERRIDE;
+
+ private:
+ CachingBitmapCanvasLayerTextureUpdater(
+ PassOwnPtr<LayerPainterChromium> painter);
tfarina 2012/10/02 21:58:29 can you go with scoped_ptr instead of PassOwnPtr?
+
+ bool texture_needs_upload_;
+ SkBitmap cached_bitmap_;
+};
tfarina 2012/10/02 21:58:29 DISALLOW_?
+
+} // namespace cc
+
+#endif // CACHINGBITMAPCANVASLAYERTEXTUREUPDATER_H_
tfarina 2012/10/02 21:58:29 CC_CACHING_BITMAP_CANVAS_LAYER_TEXTURE_UPDATER_H_

Powered by Google App Engine
This is Rietveld 408576698