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

Unified Diff: cc/resources/tile.h

Issue 15995033: cc: Low quality support for low res tiles (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase fix Created 7 years, 6 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/resources/picture_pile_impl.cc ('k') | cc/resources/tile_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/tile.h
diff --git a/cc/resources/tile.h b/cc/resources/tile.h
index 2aa4c651480412fd7a58d2a6274d484c27110d87..6f9d9871f1d32822e8b52a54bb551d1385afd289 100644
--- a/cc/resources/tile.h
+++ b/cc/resources/tile.h
@@ -10,6 +10,7 @@
#include "base/memory/scoped_vector.h"
#include "cc/resources/managed_tile_state.h"
#include "cc/resources/picture_pile_impl.h"
+#include "cc/resources/tile_manager.h"
#include "cc/resources/tile_priority.h"
#include "cc/trees/layer_tree_host_impl.h"
#include "ui/gfx/rect.h"
@@ -18,7 +19,6 @@
namespace cc {
class Tile;
-class TileManager;
class CC_EXPORT Tile : public base::RefCounted<Tile> {
public:
@@ -35,6 +35,10 @@ class CC_EXPORT Tile : public base::RefCounted<Tile> {
return picture_pile_.get();
}
+ const PicturePileImpl* picture_pile() const {
+ return picture_pile_.get();
+ }
+
const TilePriority& priority(WhichTree tree) const {
return priority_[tree];
}
@@ -58,11 +62,23 @@ class CC_EXPORT Tile : public base::RefCounted<Tile> {
scoped_ptr<base::Value> AsValue() const;
- const ManagedTileState::TileVersion& tile_version() const {
- return managed_state_.tile_version;
+ bool IsReadyToDraw(TileRasterMode* ready_mode) const {
+ for (int mode = 0; mode < NUM_RASTER_MODES; ++mode) {
+ if (managed_state_.tile_versions[mode].IsReadyToDraw()) {
+ if (ready_mode)
+ *ready_mode = static_cast<TileRasterMode>(mode);
+ return true;
+ }
+ }
+ return false;
}
- ManagedTileState::TileVersion& tile_version() {
- return managed_state_.tile_version;
+
+ const ManagedTileState::TileVersion& tile_version(TileRasterMode mode) const {
+ return managed_state_.tile_versions[mode];
+ }
+
+ ManagedTileState::TileVersion& tile_version(TileRasterMode mode) {
+ return managed_state_.tile_versions[mode];
}
gfx::Rect opaque_rect() const { return opaque_rect_; }
@@ -84,10 +100,15 @@ class CC_EXPORT Tile : public base::RefCounted<Tile> {
// For test only methods.
bool HasRasterTaskForTesting() const {
- return !managed_state().raster_task.is_null();
+ for (int mode = 0; mode < NUM_RASTER_MODES; ++mode) {
+ if (!managed_state().tile_versions[mode].raster_task_.is_null())
+ return true;
+ }
+ return false;
}
void ResetRasterTaskForTesting() {
- managed_state().raster_task.Reset();
+ for (int mode = 0; mode < NUM_RASTER_MODES; ++mode)
+ managed_state().tile_versions[mode].raster_task_.Reset();
}
private:
« no previous file with comments | « cc/resources/picture_pile_impl.cc ('k') | cc/resources/tile_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698