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

Side by Side Diff: cc/tile.cc

Issue 11348384: cc: Use asynchronous set pixels API for impl-side painting. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove ManagedTileState::resource_id. Created 8 years 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 | « cc/tile.h ('k') | cc/tile_manager.h » ('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/tile.h" 5 #include "cc/tile.h"
6 6
7 #include "cc/tile_manager.h" 7 #include "cc/tile_manager.h"
8 #include "third_party/khronos/GLES2/gl2.h" 8 #include "third_party/khronos/GLES2/gl2.h"
9 9
10 namespace cc { 10 namespace cc {
(...skipping 15 matching lines...) Expand all
26 26
27 Tile::~Tile() { 27 Tile::~Tile() {
28 tile_manager_->UnregisterTile(this); 28 tile_manager_->UnregisterTile(this);
29 } 29 }
30 30
31 void Tile::set_priority(WhichTree tree, const TilePriority& priority) { 31 void Tile::set_priority(WhichTree tree, const TilePriority& priority) {
32 tile_manager_->WillModifyTilePriority(this, tree, priority); 32 tile_manager_->WillModifyTilePriority(this, tree, priority);
33 priority_[tree] = priority; 33 priority_[tree] = priority;
34 } 34 }
35 35
36 ResourceProvider::ResourceId Tile::GetResourceId() const {
37 if (!managed_state_.resource)
38 return 0;
39 if (managed_state_.resource_is_being_initialized)
40 return 0;
41
42 return managed_state_.resource->id();
43 }
44
36 size_t Tile::bytes_consumed_if_allocated() const { 45 size_t Tile::bytes_consumed_if_allocated() const {
37 DCHECK(format_ == GL_RGBA); 46 DCHECK(format_ == GL_RGBA);
38 return 4 * tile_size_.width() * tile_size_.height(); 47 return 4 * tile_size_.width() * tile_size_.height();
39 } 48 }
40 49
41 } // namespace cc 50 } // namespace cc
OLDNEW
« no previous file with comments | « cc/tile.h ('k') | cc/tile_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698