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

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

Issue 1830453002: WebGL: GL_RGB emulation for IOSurface backed textures. [For reference only] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Compile error. Created 4 years, 8 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
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 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 1603 matching lines...) Expand 10 before | Expand all | Expand 10 after
1614 1614
1615 void Texture::ApplyFormatWorkarounds(FeatureInfo* feature_info) { 1615 void Texture::ApplyFormatWorkarounds(FeatureInfo* feature_info) {
1616 if (feature_info->gl_version_info().is_desktop_core_profile) { 1616 if (feature_info->gl_version_info().is_desktop_core_profile) {
1617 if (static_cast<size_t>(base_level_) >= face_infos_[0].level_infos.size()) 1617 if (static_cast<size_t>(base_level_) >= face_infos_[0].level_infos.size())
1618 return; 1618 return;
1619 const Texture::LevelInfo& info = face_infos_[0].level_infos[base_level_]; 1619 const Texture::LevelInfo& info = face_infos_[0].level_infos[base_level_];
1620 SetCompatibilitySwizzle(GetCompatibilitySwizzle(info.format)); 1620 SetCompatibilitySwizzle(GetCompatibilitySwizzle(info.format));
1621 } 1621 }
1622 } 1622 }
1623 1623
1624 bool Texture::EmulatingRGB() {
1625 for (const FaceInfo& face_info : face_infos_) {
1626 for (const LevelInfo& level_info : face_info.level_infos) {
1627 if (level_info.image && level_info.image->EmulatingRGB())
1628 return true;
1629 }
1630 }
1631 return false;
1632 }
1633
1624 TextureRef::TextureRef(TextureManager* manager, 1634 TextureRef::TextureRef(TextureManager* manager,
1625 GLuint client_id, 1635 GLuint client_id,
1626 Texture* texture) 1636 Texture* texture)
1627 : manager_(manager), 1637 : manager_(manager),
1628 texture_(texture), 1638 texture_(texture),
1629 client_id_(client_id), 1639 client_id_(client_id),
1630 num_observers_(0) { 1640 num_observers_(0) {
1631 DCHECK(manager_); 1641 DCHECK(manager_);
1632 DCHECK(texture_); 1642 DCHECK(texture_);
1633 texture_->AddTextureRef(this); 1643 texture_->AddTextureRef(this);
(...skipping 1500 matching lines...) Expand 10 before | Expand all | Expand 10 after
3134 uint32_t TextureManager::GetServiceIdGeneration() const { 3144 uint32_t TextureManager::GetServiceIdGeneration() const {
3135 return current_service_id_generation_; 3145 return current_service_id_generation_;
3136 } 3146 }
3137 3147
3138 void TextureManager::IncrementServiceIdGeneration() { 3148 void TextureManager::IncrementServiceIdGeneration() {
3139 current_service_id_generation_++; 3149 current_service_id_generation_++;
3140 } 3150 }
3141 3151
3142 } // namespace gles2 3152 } // namespace gles2
3143 } // namespace gpu 3153 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/texture_manager.h ('k') | gpu/command_buffer/service/texture_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698