| Index: cc/picture_layer_impl.cc
|
| diff --git a/cc/picture_layer_impl.cc b/cc/picture_layer_impl.cc
|
| index f0ce9ad08e8a14dbab093b68dad4f40b06c86af2..b11c4889ea0938bbe9a4f214f5afd7dc0a0fa0e6 100644
|
| --- a/cc/picture_layer_impl.cc
|
| +++ b/cc/picture_layer_impl.cc
|
| @@ -115,7 +115,7 @@ void PictureLayerImpl::appendQuads(QuadSink& quadSink,
|
| ++iter) {
|
| SkColor color;
|
| float width;
|
| - if (*iter && iter->GetResourceId()) {
|
| + if (*iter && iter->drawing_info().IsReadyToDraw()) {
|
| if (iter->priority(ACTIVE_TREE).resolution == HIGH_RESOLUTION) {
|
| color = DebugColors::HighResTileBorderColor();
|
| width = DebugColors::HighResTileBorderWidth(layerTreeImpl());
|
| @@ -153,13 +153,9 @@ void PictureLayerImpl::appendQuads(QuadSink& quadSink,
|
| layerDeviceAlignment);
|
| iter;
|
| ++iter) {
|
| - ResourceProvider::ResourceId resource = 0;
|
| - if (*iter)
|
| - resource = iter->GetResourceId();
|
|
|
| gfx::Rect geometry_rect = iter.geometry_rect();
|
| -
|
| - if (!resource) {
|
| + if (!*iter || !iter->drawing_info().IsReadyToDraw()) {
|
| if (drawCheckerboardForMissingTiles()) {
|
| // TODO(enne): Figure out how to show debug "invalidated checker" color
|
| scoped_ptr<CheckerboardDrawQuad> quad = CheckerboardDrawQuad::Create();
|
| @@ -178,31 +174,50 @@ void PictureLayerImpl::appendQuads(QuadSink& quadSink,
|
| continue;
|
| }
|
|
|
| - if (iter->contents_scale() != ideal_contents_scale_)
|
| - appendQuadsData.hadIncompleteTile = true;
|
| -
|
| - gfx::RectF texture_rect = iter.texture_rect();
|
| - gfx::Rect opaque_rect = iter->opaque_rect();
|
| - opaque_rect.Intersect(content_rect);
|
| -
|
| - bool outside_left_edge = geometry_rect.x() == content_rect.x();
|
| - bool outside_top_edge = geometry_rect.y() == content_rect.y();
|
| - bool outside_right_edge = geometry_rect.right() == content_rect.right();
|
| - bool outside_bottom_edge = geometry_rect.bottom() == content_rect.bottom();
|
| -
|
| - scoped_ptr<TileDrawQuad> quad = TileDrawQuad::Create();
|
| - quad->SetNew(sharedQuadState,
|
| - geometry_rect,
|
| - opaque_rect,
|
| - resource,
|
| - texture_rect,
|
| - iter.texture_size(),
|
| - iter->contents_swizzled(),
|
| - outside_left_edge && useAA,
|
| - outside_top_edge && useAA,
|
| - outside_right_edge && useAA,
|
| - outside_bottom_edge && useAA);
|
| - quadSink.append(quad.PassAs<DrawQuad>(), appendQuadsData);
|
| + const TileDrawingInfo& drawing_info = iter->drawing_info();
|
| + switch (drawing_info.mode()) {
|
| + case TileDrawingInfo::TEXTURE_MODE: {
|
| + if (iter->contents_scale() != ideal_contents_scale_)
|
| + appendQuadsData.hadIncompleteTile = true;
|
| +
|
| + gfx::RectF texture_rect = iter.texture_rect();
|
| + gfx::Rect opaque_rect = iter->opaque_rect();
|
| + opaque_rect.Intersect(content_rect);
|
| +
|
| + bool outside_left_edge = geometry_rect.x() == content_rect.x();
|
| + bool outside_top_edge = geometry_rect.y() == content_rect.y();
|
| + bool outside_right_edge = geometry_rect.right() == content_rect.right();
|
| + bool outside_bottom_edge = geometry_rect.bottom() == content_rect.bottom();
|
| +
|
| + scoped_ptr<TileDrawQuad> quad = TileDrawQuad::Create();
|
| + quad->SetNew(sharedQuadState,
|
| + geometry_rect,
|
| + opaque_rect,
|
| + drawing_info.get_resource_id(),
|
| + texture_rect,
|
| + iter.texture_size(),
|
| + drawing_info.contents_swizzled(),
|
| + outside_left_edge && useAA,
|
| + outside_top_edge && useAA,
|
| + outside_right_edge && useAA,
|
| + outside_bottom_edge && useAA);
|
| + quadSink.append(quad.PassAs<DrawQuad>(), appendQuadsData);
|
| + break;
|
| + }
|
| + case TileDrawingInfo::SOLID_COLOR_MODE: {
|
| + scoped_ptr<SolidColorDrawQuad> quad = SolidColorDrawQuad::Create();
|
| + quad->SetNew(sharedQuadState,
|
| + geometry_rect,
|
| + drawing_info.get_solid_color());
|
| + break;
|
| + }
|
| + case TileDrawingInfo::TRANSPARENT_MODE:
|
| + break;
|
| + case TileDrawingInfo::PICTURE_PILE_MODE:
|
| + // TODO: crbug.com/173011 would fill this part in.
|
| + default:
|
| + NOTREACHED();
|
| + }
|
|
|
| if (!seen_tilings.size() || seen_tilings.back() != iter.CurrentTiling())
|
| seen_tilings.push_back(iter.CurrentTiling());
|
| @@ -473,12 +488,14 @@ ResourceProvider::ResourceId PictureLayerImpl::contentsResourceId() const {
|
| iter;
|
| ++iter) {
|
| // Mask resource not ready yet.
|
| - if (!*iter || !iter->GetResourceId())
|
| + if (!*iter ||
|
| + !iter->drawing_info().mode() != TileDrawingInfo::TEXTURE_MODE ||
|
| + !iter->drawing_info().IsReadyToDraw())
|
| return 0;
|
| // Masks only supported if they fit on exactly one tile.
|
| if (iter.geometry_rect() != content_rect)
|
| return 0;
|
| - return iter->GetResourceId();
|
| + return iter->drawing_info().get_resource_id();
|
| }
|
| return 0;
|
| }
|
| @@ -522,7 +539,7 @@ bool PictureLayerImpl::areVisibleResourcesReady() const {
|
| iter;
|
| ++iter) {
|
| // A null tile (i.e. no recording) is considered "ready".
|
| - if (!*iter || iter->GetResourceId())
|
| + if (!*iter || iter->drawing_info().IsReadyToDraw())
|
| missing_region.Subtract(iter.geometry_rect());
|
| }
|
| }
|
|
|