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

Unified Diff: cc/layers/picture_layer_impl.cc

Issue 12642010: Implement on demand quad rasterization for PicturePiles. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase & introduce ResizeResource. Created 7 years, 9 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/layers/picture_layer_impl.cc
diff --git a/cc/layers/picture_layer_impl.cc b/cc/layers/picture_layer_impl.cc
index fd4a85ae1caa3b84baf979acd5d26efc89d90fb5..4516215e3e5510de098031b5917864554fc30e82 100644
--- a/cc/layers/picture_layer_impl.cc
+++ b/cc/layers/picture_layer_impl.cc
@@ -12,6 +12,7 @@
#include "cc/layers/quad_sink.h"
#include "cc/quads/checkerboard_draw_quad.h"
#include "cc/quads/debug_border_draw_quad.h"
+#include "cc/quads/picture_draw_quad.h"
#include "cc/quads/solid_color_draw_quad.h"
#include "cc/quads/tile_draw_quad.h"
#include "cc/trees/layer_tree_impl.h"
@@ -111,6 +112,9 @@ void PictureLayerImpl::AppendQuads(QuadSink* quadSink,
mode == ManagedTileState::DrawingInfo::TRANSPARENT_MODE) {
color = DebugColors::SolidColorTileBorderColor();
width = DebugColors::SolidColorTileBorderWidth(layer_tree_impl());
+ } else if (mode == ManagedTileState::DrawingInfo::PICTURE_PILE_MODE) {
+ color = DebugColors::PictureTileBorderColor();
+ width = DebugColors::PictureTileBorderWidth(layer_tree_impl());
} else if (iter->priority(ACTIVE_TREE).resolution == HIGH_RESOLUTION) {
color = DebugColors::HighResTileBorderColor();
width = DebugColors::HighResTileBorderWidth(layer_tree_impl());
@@ -169,11 +173,15 @@ void PictureLayerImpl::AppendQuads(QuadSink* quadSink,
}
const ManagedTileState::DrawingInfo& drawing_info = iter->drawing_info();
- switch (drawing_info.mode()) {
- case ManagedTileState::DrawingInfo::TEXTURE_MODE: {
- if (iter->contents_scale() != ideal_contents_scale_)
- appendQuadsData->hadIncompleteTile = true;
+ const ManagedTileState::DrawingInfo::Mode mode = drawing_info.mode();
danakj 2013/03/22 18:02:41 don't use const for non-pointer/reference local va
Leandro Graciá Gil 2013/03/22 20:40:58 Done.
+ if (mode == ManagedTileState::DrawingInfo::TEXTURE_MODE ||
+ mode == ManagedTileState::DrawingInfo::PICTURE_PILE_MODE) {
+ if (iter->contents_scale() != ideal_contents_scale_)
+ appendQuadsData->hadIncompleteTile = true;
+ }
+ switch (mode) {
+ case ManagedTileState::DrawingInfo::TEXTURE_MODE: {
gfx::RectF texture_rect = iter.texture_rect();
gfx::Rect opaque_rect = iter->opaque_rect();
opaque_rect.Intersect(content_rect);
@@ -189,6 +197,26 @@ void PictureLayerImpl::AppendQuads(QuadSink* quadSink,
quadSink->Append(quad.PassAs<DrawQuad>(), appendQuadsData);
break;
}
+
danakj 2013/03/22 18:02:41 nit: no blank lines between cases
Leandro Graciá Gil 2013/03/22 20:40:58 Done.
+ case ManagedTileState::DrawingInfo::PICTURE_PILE_MODE: {
+ gfx::RectF texture_rect = iter.texture_rect();
+ gfx::Rect opaque_rect = iter->opaque_rect();
+ opaque_rect.Intersect(content_rect);
+
+ scoped_ptr<PictureDrawQuad> quad = PictureDrawQuad::Create();
+ quad->SetNew(sharedQuadState,
+ geometry_rect,
+ opaque_rect,
+ texture_rect,
+ iter.texture_size(),
+ drawing_info.contents_swizzled(),
vmpstr 2013/03/22 18:29:32 I think contents_swizzled might not be set for pic
Leandro Graciá Gil 2013/03/22 20:40:58 Good catch! Fixed.
+ iter->content_rect(),
+ iter->contents_scale(),
+ pile_);
+ quadSink->Append(quad.PassAs<DrawQuad>(), appendQuadsData);
+ break;
+ }
+
danakj 2013/03/22 18:02:41 nit: and here
Leandro Graciá Gil 2013/03/22 20:40:58 Done.
case ManagedTileState::DrawingInfo::SOLID_COLOR_MODE: {
scoped_ptr<SolidColorDrawQuad> quad = SolidColorDrawQuad::Create();
quad->SetNew(sharedQuadState,
@@ -199,8 +227,6 @@ void PictureLayerImpl::AppendQuads(QuadSink* quadSink,
}
case ManagedTileState::DrawingInfo::TRANSPARENT_MODE:
break;
- case ManagedTileState::DrawingInfo::PICTURE_PILE_MODE:
- // TODO: crbug.com/173011 would fill this part in.
default:
NOTREACHED();
}

Powered by Google App Engine
This is Rietveld 408576698