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

Side by Side Diff: gpu/command_buffer/service/texture_manager.cc

Issue 180723023: gpu: Mailbox emulation with EGLImage (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "gpu/command_buffer/service/texture_manager.h" 5 #include "gpu/command_buffer/service/texture_manager.h"
6 #include "base/bits.h" 6 #include "base/bits.h"
7 #include "base/strings/stringprintf.h" 7 #include "base/strings/stringprintf.h"
8 #include "gpu/command_buffer/common/gles2_cmd_utils.h" 8 #include "gpu/command_buffer/common/gles2_cmd_utils.h"
9 #include "gpu/command_buffer/service/context_state.h" 9 #include "gpu/command_buffer/service/context_state.h"
10 #include "gpu/command_buffer/service/error_state.h" 10 #include "gpu/command_buffer/service/error_state.h"
(...skipping 799 matching lines...) Expand 10 before | Expand all | Expand 10 after
810 if (level >= 0 && face_index < level_infos_.size() && 810 if (level >= 0 && face_index < level_infos_.size() &&
811 static_cast<size_t>(level) < level_infos_[face_index].size()) { 811 static_cast<size_t>(level) < level_infos_[face_index].size()) {
812 const LevelInfo& info = level_infos_[GLTargetToFaceIndex(target)][level]; 812 const LevelInfo& info = level_infos_[GLTargetToFaceIndex(target)][level];
813 if (info.target != 0) { 813 if (info.target != 0) {
814 return info.image.get(); 814 return info.image.get();
815 } 815 }
816 } 816 }
817 return 0; 817 return 0;
818 } 818 }
819 819
820 void Texture::OnWillModifyPixels() {
821 if (target()) {
822 gfx::GLImage* image = GetLevelImage(target(), 0);
823 if (image)
824 image->WillModifyPixels();
825 }
826 }
827
828 void Texture::OnDidModifyPixels() {
829 if (target()) {
830 gfx::GLImage* image = GetLevelImage(target(), 0);
831 if (image)
832 image->DidModifyPixels();
833 }
834 }
820 835
821 TextureRef::TextureRef(TextureManager* manager, 836 TextureRef::TextureRef(TextureManager* manager,
822 GLuint client_id, 837 GLuint client_id,
823 Texture* texture) 838 Texture* texture)
824 : manager_(manager), 839 : manager_(manager),
825 texture_(texture), 840 texture_(texture),
826 client_id_(client_id) { 841 client_id_(client_id) {
827 DCHECK(manager_); 842 DCHECK(manager_);
828 DCHECK(texture_); 843 DCHECK(texture_);
829 texture_->AddTextureRef(this); 844 texture_->AddTextureRef(this);
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after
1493 } 1508 }
1494 1509
1495 ScopedTextureUploadTimer::~ScopedTextureUploadTimer() { 1510 ScopedTextureUploadTimer::~ScopedTextureUploadTimer() {
1496 texture_state_->texture_upload_count++; 1511 texture_state_->texture_upload_count++;
1497 texture_state_->total_texture_upload_time += 1512 texture_state_->total_texture_upload_time +=
1498 base::TimeTicks::HighResNow() - begin_time_; 1513 base::TimeTicks::HighResNow() - begin_time_;
1499 } 1514 }
1500 1515
1501 } // namespace gles2 1516 } // namespace gles2
1502 } // namespace gpu 1517 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698