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

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

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 unified diff | Download patch
« no previous file with comments | « cc/resources/picture.cc ('k') | cc/resources/picture_layer_tiling_set.cc » ('j') | 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/picture_layer_tiling.h" 5 #include "cc/resources/picture_layer_tiling.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 state->SetDouble("content_scale", contents_scale_); 490 state->SetDouble("content_scale", contents_scale_);
491 state->Set("content_bounds", 491 state->Set("content_bounds",
492 MathUtil::AsValue(ContentRect().size()).release()); 492 MathUtil::AsValue(ContentRect().size()).release());
493 return state.PassAs<base::Value>(); 493 return state.PassAs<base::Value>();
494 } 494 }
495 495
496 size_t PictureLayerTiling::GPUMemoryUsageInBytes() const { 496 size_t PictureLayerTiling::GPUMemoryUsageInBytes() const {
497 size_t amount = 0; 497 size_t amount = 0;
498 for (TileMap::const_iterator it = tiles_.begin(); it != tiles_.end(); ++it) { 498 for (TileMap::const_iterator it = tiles_.begin(); it != tiles_.end(); ++it) {
499 const Tile* tile = it->second.get(); 499 const Tile* tile = it->second.get();
500 amount += tile->tile_version().GPUMemoryUsageInBytes(); 500 for (int mode = 0; mode < NUM_RASTER_MODES; ++mode) {
501 amount += tile->tile_version(
502 static_cast<TileRasterMode>(mode)).GPUMemoryUsageInBytes();
503 }
501 } 504 }
502 return amount; 505 return amount;
503 } 506 }
504 507
505 namespace { 508 namespace {
506 509
507 // This struct represents an event at which the expending rect intersects 510 // This struct represents an event at which the expending rect intersects
508 // one of its boundaries. 4 intersection events will occur during expansion. 511 // one of its boundaries. 4 intersection events will occur during expansion.
509 struct EdgeEvent { 512 struct EdgeEvent {
510 enum { BOTTOM, TOP, LEFT, RIGHT } edge; 513 enum { BOTTOM, TOP, LEFT, RIGHT } edge;
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
621 624
622 // If our delta is less then our event distance, we're done. 625 // If our delta is less then our event distance, we're done.
623 if (delta < event.distance) 626 if (delta < event.distance)
624 break; 627 break;
625 } 628 }
626 629
627 return gfx::Rect(origin_x, origin_y, width, height); 630 return gfx::Rect(origin_x, origin_y, width, height);
628 } 631 }
629 632
630 } // namespace cc 633 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/picture.cc ('k') | cc/resources/picture_layer_tiling_set.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698