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

Side by Side Diff: cc/resources/tile_manager.cc

Issue 16268021: [Fix build] TileRasterMode value passed to IsReadyToDraw must be initialized. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/resources/tile_manager.h" 5 #include "cc/resources/tile_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 size_t* memory_used_bytes) const { 354 size_t* memory_used_bytes) const {
355 *memory_required_bytes = 0; 355 *memory_required_bytes = 0;
356 *memory_nice_to_have_bytes = 0; 356 *memory_nice_to_have_bytes = 0;
357 *memory_used_bytes = resource_pool_->acquired_memory_usage_bytes(); 357 *memory_used_bytes = resource_pool_->acquired_memory_usage_bytes();
358 for (TileVector::const_iterator it = tiles_.begin(); 358 for (TileVector::const_iterator it = tiles_.begin();
359 it != tiles_.end(); 359 it != tiles_.end();
360 ++it) { 360 ++it) {
361 const Tile* tile = *it; 361 const Tile* tile = *it;
362 const ManagedTileState& mts = tile->managed_state(); 362 const ManagedTileState& mts = tile->managed_state();
363 363
364 TileRasterMode mode; 364 TileRasterMode mode = HIGH_QUALITY_RASTER_MODE;
365 if (tile->IsReadyToDraw(&mode) && 365 if (tile->IsReadyToDraw(&mode) &&
366 !mts.tile_versions[mode].requires_resource()) 366 !mts.tile_versions[mode].requires_resource())
367 continue; 367 continue;
368 368
369 size_t tile_bytes = tile->bytes_consumed_if_allocated(); 369 size_t tile_bytes = tile->bytes_consumed_if_allocated();
370 if (mts.gpu_memmgr_stats_bin == NOW_BIN) 370 if (mts.gpu_memmgr_stats_bin == NOW_BIN)
371 *memory_required_bytes += tile_bytes; 371 *memory_required_bytes += tile_bytes;
372 if (mts.gpu_memmgr_stats_bin != NEVER_BIN) 372 if (mts.gpu_memmgr_stats_bin != NEVER_BIN)
373 *memory_nice_to_have_bytes += tile_bytes; 373 *memory_nice_to_have_bytes += tile_bytes;
374 } 374 }
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
615 mts.tile_versions[mode].forced_upload_ = false; 615 mts.tile_versions[mode].forced_upload_ = false;
616 } 616 }
617 617
618 void TileManager::FreeResourcesForTile(Tile* tile) { 618 void TileManager::FreeResourcesForTile(Tile* tile) {
619 for (int mode = 0; mode < NUM_RASTER_MODES; ++mode) { 619 for (int mode = 0; mode < NUM_RASTER_MODES; ++mode) {
620 FreeResourceForTile(tile, static_cast<TileRasterMode>(mode)); 620 FreeResourceForTile(tile, static_cast<TileRasterMode>(mode));
621 } 621 }
622 } 622 }
623 623
624 void TileManager::FreeUnusedResourcesForTile(Tile* tile) { 624 void TileManager::FreeUnusedResourcesForTile(Tile* tile) {
625 TileRasterMode used_mode; 625 TileRasterMode used_mode = HIGH_QUALITY_RASTER_MODE;
626 bool version_is_used = tile->IsReadyToDraw(&used_mode); 626 bool version_is_used = tile->IsReadyToDraw(&used_mode);
627 for (int mode = 0; mode < NUM_RASTER_MODES; ++mode) { 627 for (int mode = 0; mode < NUM_RASTER_MODES; ++mode) {
628 if (!version_is_used || mode != used_mode) 628 if (!version_is_used || mode != used_mode)
629 FreeResourceForTile(tile, static_cast<TileRasterMode>(mode)); 629 FreeResourceForTile(tile, static_cast<TileRasterMode>(mode));
630 } 630 }
631 } 631 }
632 632
633 void TileManager::ScheduleTasks() { 633 void TileManager::ScheduleTasks() {
634 TRACE_EVENT0("cc", "TileManager::ScheduleTasks"); 634 TRACE_EVENT0("cc", "TileManager::ScheduleTasks");
635 RasterWorkerPool::RasterTask::Queue tasks; 635 RasterWorkerPool::RasterTask::Queue tasks;
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
953 100000, 953 100000,
954 100); 954 100);
955 } else { 955 } else {
956 picture_pile->RasterToBitmap(&canvas, rect, contents_scale, NULL); 956 picture_pile->RasterToBitmap(&canvas, rect, contents_scale, NULL);
957 } 957 }
958 958
959 return true; 959 return true;
960 } 960 }
961 961
962 } // namespace cc 962 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698