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

Unified Diff: cc/layers/tiled_layer_impl.cc

Issue 659683002: Include mask texture size in RenderPassDrawQuad (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@update_mask_draw_quad_test
Patch Set: No ToEnclosedRect Created 6 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/layers/tiled_layer_impl.h ('k') | cc/layers/tiled_layer_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/tiled_layer_impl.cc
diff --git a/cc/layers/tiled_layer_impl.cc b/cc/layers/tiled_layer_impl.cc
index 5a0e81d5fd7078499bbca24b234df1daa6e2a26f..605259106be679d4ee4a007fbdcfb8682368b5bf 100644
--- a/cc/layers/tiled_layer_impl.cc
+++ b/cc/layers/tiled_layer_impl.cc
@@ -53,21 +53,25 @@ TiledLayerImpl::TiledLayerImpl(LayerTreeImpl* tree_impl, int id)
TiledLayerImpl::~TiledLayerImpl() {
}
-ResourceProvider::ResourceId TiledLayerImpl::ContentsResourceId() const {
+void TiledLayerImpl::GetContentsResourceId(
+ ResourceProvider::ResourceId* resource_id,
+ gfx::Size* resource_size) const {
// This function is only valid for single texture layers, e.g. masks.
DCHECK(tiler_);
// It's possible the mask layer is created but has no size or otherwise
// can't draw.
- if (tiler_->num_tiles_x() == 0 || tiler_->num_tiles_y() == 0)
- return 0;
+ if (tiler_->num_tiles_x() == 0 || tiler_->num_tiles_y() == 0) {
+ *resource_id = 0;
+ return;
+ }
// Any other number of tiles other than 0 or 1 is incorrect for masks.
DCHECK_EQ(tiler_->num_tiles_x(), 1);
DCHECK_EQ(tiler_->num_tiles_y(), 1);
DrawableTile* tile = TileAt(0, 0);
- ResourceProvider::ResourceId resource_id = tile ? tile->resource_id() : 0;
- return resource_id;
+ *resource_id = tile ? tile->resource_id() : 0;
+ *resource_size = tiler_->tile_size();
}
bool TiledLayerImpl::HasTileAt(int i, int j) const {
« no previous file with comments | « cc/layers/tiled_layer_impl.h ('k') | cc/layers/tiled_layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698