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

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

Issue 12642010: Implement on demand quad rasterization for PicturePiles. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase. 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 unified diff | Download patch | Annotate | Revision Log
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 575 matching lines...) Expand 10 before | Expand all | Expand 10 after
586 mts.can_use_gpu_memory = false; 586 mts.can_use_gpu_memory = false;
587 FreeResourcesForTile(tile); 587 FreeResourcesForTile(tile);
588 continue; 588 continue;
589 } 589 }
590 if (tile_bytes > bytes_left) { 590 if (tile_bytes > bytes_left) {
591 mts.can_use_gpu_memory = false; 591 mts.can_use_gpu_memory = false;
592 if (mts.bin[HIGH_PRIORITY_BIN] == NOW_BIN || 592 if (mts.bin[HIGH_PRIORITY_BIN] == NOW_BIN ||
593 mts.bin[LOW_PRIORITY_BIN] == NOW_BIN) 593 mts.bin[LOW_PRIORITY_BIN] == NOW_BIN)
594 bytes_that_exceeded_memory_budget_in_now_bin += tile_bytes; 594 bytes_that_exceeded_memory_budget_in_now_bin += tile_bytes;
595 FreeResourcesForTile(tile); 595 FreeResourcesForTile(tile);
596 tile->drawing_info().set_rasterize_on_demand();
597 tile->drawing_info().set_contents_swizzled(
598 !PlatformColor::SameComponentOrder(tile->format_));
596 continue; 599 continue;
597 } 600 }
601 tile->drawing_info().set_use_resource();
598 bytes_left -= tile_bytes; 602 bytes_left -= tile_bytes;
599 mts.can_use_gpu_memory = true; 603 mts.can_use_gpu_memory = true;
600 if (!tile->drawing_info().resource_ && 604 if (!tile->drawing_info().resource_ &&
601 !tile->drawing_info().resource_is_being_initialized_) { 605 !tile->drawing_info().resource_is_being_initialized_) {
602 tiles_that_need_to_be_rasterized_.push_back(tile); 606 tiles_that_need_to_be_rasterized_.push_back(tile);
603 DidTileRasterStateChange(tile, WAITING_FOR_RASTER_STATE); 607 DidTileRasterStateChange(tile, WAITING_FOR_RASTER_STATE);
604 } 608 }
605 } 609 }
606 610
607 ever_exceeded_memory_budget_ |= 611 ever_exceeded_memory_budget_ |=
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after
1087 skia::LazyPixelRef* pixel_ref, 1091 skia::LazyPixelRef* pixel_ref,
1088 RenderingStatsInstrumentation* stats_instrumentation) { 1092 RenderingStatsInstrumentation* stats_instrumentation) {
1089 TRACE_EVENT0("cc", "TileManager::RunImageDecodeTask"); 1093 TRACE_EVENT0("cc", "TileManager::RunImageDecodeTask");
1090 base::TimeTicks start_time = stats_instrumentation->StartRecording(); 1094 base::TimeTicks start_time = stats_instrumentation->StartRecording();
1091 pixel_ref->Decode(); 1095 pixel_ref->Decode();
1092 base::TimeDelta duration = stats_instrumentation->EndRecording(start_time); 1096 base::TimeDelta duration = stats_instrumentation->EndRecording(start_time);
1093 stats_instrumentation->AddDeferredImageDecode(duration); 1097 stats_instrumentation->AddDeferredImageDecode(duration);
1094 } 1098 }
1095 1099
1096 } // namespace cc 1100 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/managed_tile_state.cc ('k') | cc/trees/layer_tree_host_pixeltest_on_demand_raster.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698