#include "cc/trees/layer_tree_host.h"
#include "cc/trees/occlusion_tracker.h"
#include "third_party/khronos/GLES2/gl2.h"
-#include "ui/gfx/rect_conversions.h"
+#include "ui/gfx/geometry/rect_conversions.h"
namespace cc {
TiledLayer::~TiledLayer() {}
scoped_ptr<LayerImpl> TiledLayer::CreateLayerImpl(LayerTreeImpl* tree_impl) {
- return TiledLayerImpl::Create(tree_impl, id()).PassAs<LayerImpl>();
+ return TiledLayerImpl::Create(tree_impl, id());
}
void TiledLayer::UpdateTileSizeAndTilingOption() {
PrioritizedResourceManager* TiledLayer::ResourceManager() {
if (!layer_tree_host())
- return NULL;
+ return nullptr;
return layer_tree_host()->contents_texture_manager();
}
int j) const {
UpdatableTile* tile = TileAt(i, j);
if (!tile)
- return NULL;
+ return nullptr;
return tile->managed_resource();
}
tile->managed_resource()->SetDimensions(tiler_->tile_size(), texture_format_);
UpdatableTile* added_tile = tile.get();
- tiler_->AddTile(tile.PassAs<LayerTilingData::Tile>(), i, j);
+ tiler_->AddTile(tile.Pass(), i, j);
added_tile->dirty_rect = tiler_->TileRect(added_tile);
return added_tile;
}
-void TiledLayer::SetNeedsDisplayRect(const gfx::RectF& dirty_rect) {
+void TiledLayer::SetNeedsDisplayRect(const gfx::Rect& dirty_rect) {
InvalidateContentRect(LayerRectToContentRect(dirty_rect));
ContentsScalingLayer::SetNeedsDisplayRect(dirty_rect);
}
// paint_rect from content space to layer space.
float width_scale = 1 / draw_properties().contents_scale_x;
float height_scale = 1 / draw_properties().contents_scale_y;
- update_rect_ = gfx::ScaleRect(update_rect, width_scale, height_scale);
+ update_rect_ =
+ gfx::ScaleToEnclosingRect(update_rect, width_scale, height_scale);
// Calling PrepareToUpdate() calls into WebKit to paint, which may have the
// side effect of disabling compositing, which causes our reference to the
&top,
&right,
&bottom);
- UpdateTiles(left, top, right, bottom, queue, NULL, &updated);
+ UpdateTiles(left, top, right, bottom, queue, nullptr, &updated);
if (updated)
return updated;
// This was an attempt to paint the entire layer so if we fail it's okay,
return updated;
// Prepaint anything that was occluded but inside the layer's visible region.
- if (!UpdateTiles(left, top, right, bottom, queue, NULL, &updated) ||
+ if (!UpdateTiles(left, top, right, bottom, queue, nullptr, &updated) ||
updated)
return updated;
while (bottom < prepaint_bottom) {
++bottom;
if (!UpdateTiles(
- left, bottom, right, bottom, queue, NULL, &updated) ||
+ left, bottom, right, bottom, queue, nullptr, &updated) ||
updated)
return updated;
}
if (deltas[i].y() < 0) {
while (top > prepaint_top) {
--top;
- if (!UpdateTiles(
- left, top, right, top, queue, NULL, &updated) ||
+ if (!UpdateTiles(left, top, right, top, queue, nullptr, &updated) ||
updated)
return updated;
}
if (deltas[i].x() < 0) {
while (left > prepaint_left) {
--left;
- if (!UpdateTiles(
- left, top, left, bottom, queue, NULL, &updated) ||
+ if (!UpdateTiles(left, top, left, bottom, queue, nullptr, &updated) ||
updated)
return updated;
}
if (deltas[i].x() > 0) {
while (right < prepaint_right) {
++right;
- if (!UpdateTiles(
- right, top, right, bottom, queue, NULL, &updated) ||
+ if (!UpdateTiles(right, top, right, bottom, queue, nullptr, &updated) ||
updated)
return updated;
}