Skip to content
This repository has been archived by the owner. It is now read-only.

fixing an invalid conversion in src/gpu/gl/GrGLCreateNullInterface.cpp #3

Merged
merged 1 commit into from Apr 4, 2013

Conversation

@luisbg
Copy link
Contributor

luisbg commented Apr 4, 2013

Thanks :)

jdm added a commit that referenced this pull request Apr 4, 2013
fixing an invalid conversion in src/gpu/gl/GrGLCreateNullInterface.cpp
@jdm jdm merged commit f66dcf6 into servo:master Apr 4, 2013
@kramerc
Copy link

kramerc commented Apr 5, 2013

Unfortunately, this change has caused building to fail when on Mac OS X.

Kramers-MacBook-Pro:build kramer$ make
mkdir -p `dirname src/gpu/gl/mac/GrGLCreateNativeInterface_mac.o` && c++ -c -fPIC -O3 -mssse3 -I/Users/kramer/Documents/Workspaces/servo/src/skia/include/config -I/Users/kramer/Documents/Workspaces/servo/src/skia/include/core -I/Users/kramer/Documents/Workspaces/servo/src/skia/include/effects -I/Users/kramer/Documents/Workspaces/servo/src/skia/include/gpu -I/Users/kramer/Documents/Workspaces/servo/src/skia/include/ports -I/Users/kramer/Documents/Workspaces/servo/src/skia/src/core -I/Users/kramer/Documents/Workspaces/servo/src/skia/src/image -iquote /Users/kramer/Documents/Workspaces/servo/src/skia/src/gpu  -I/Users/kramer/Documents/Workspaces/servo/src/skia/include/utils/mac  -o src/gpu/gl/mac/GrGLCreateNativeInterface_mac.o /Users/kramer/Documents/Workspaces/servo/src/skia/src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp
/Users/kramer/Documents/Workspaces/servo/src/skia/src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp:112:34: error: no viable overloaded '='
        interface->fShaderSource = glShaderSource;
        ~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~
/Users/kramer/Documents/Workspaces/servo/src/skia/include/gpu/gl/GrGLInterface.h:113:42: note: candidate function
      (the implicit copy assignment operator) not viable: no known conversion from 'void (GLuint, GLsizei, const GLchar **, const GLint *)' to 'const
      GrGLInterface::GLPtr<void (*)(unsigned int, int, const char *const *, const int *)>' for 1st argument
    template <typename FNPTR_TYPE> class GLPtr {
                                         ^
/Users/kramer/Documents/Workspaces/servo/src/skia/include/gpu/gl/GrGLInterface.h:116:15: note: candidate function not viable: no known conversion from
      'void (GLuint, GLsizei, const GLchar **, const GLint *)' to 'void (*)(unsigned int, int, const char *const *, const int *)' for 1st argument
        GLPtr operator =(FNPTR_TYPE ptr) { fPtr = ptr; return *this; }
              ^
1 error generated.
make[1]: *** [src/gpu/gl/mac/GrGLCreateNativeInterface_mac.o] Error 1
make: *** [/Users/kramer/Documents/Workspaces/servo/build/src/skia/lib*.dummy] Error 2
@jdm
Copy link
Member

jdm commented Apr 5, 2013

Paging @metajack.

@metajack
Copy link
Contributor

metajack commented Apr 5, 2013

What version of OS X and what version of Xcode do you have? It's building cleaning for me on 10.8.3 with XCode 4.6.1.

@kramerc
Copy link

kramerc commented Apr 5, 2013

I am on the same versions as you are. Changing const char* const* str back to const char** str did result in a successful build for me.

@metajack
Copy link
Contributor

metajack commented Apr 5, 2013

Did you upgrade your machine? The OpenGL headers I have from a fresh 10.8.3 install (and Xcode 4.6.1 was the first version installed here) require char* const* str, which is also the current specification of OpenGL. I'm just curious how we ended up with different headers.

In any case, the only fix for this will be to detect this issue and change the declaration accordingly. This happens in upstream Skia. I'll try and backport that today.

@kramerc
Copy link

kramerc commented Apr 5, 2013

My Mac originally came with 10.8.2. I noticed there was an update for Command Line Tools in the Xcode Preferences. After updating that, I now have the updated OpenGL headers that has const char* const* str and Skia builds successfully without my change.

@luisbg
Copy link
Contributor Author

luisbg commented Apr 5, 2013

Kramer, what is your version of OpenGL after the upgrade?

@kramerc
Copy link

kramerc commented Apr 5, 2013

If I'm looking in the right spot, it appears to be OpenGL 1.8.7.25.0 according to Resources/Info.plist inside OpenGL.framework.

@jdm
Copy link
Member

jdm commented Apr 5, 2013

Should be fixed for all platforms as of 8f7ac7ba3742cde9c8a61d36e1251f9c766620ea.

@metajack
Copy link
Contributor

metajack commented Apr 5, 2013

Ok. I just pushed some changes that should fix this. I saw that upstream was using casts in this case sometimes, so I added the casts and everyone seems to report happiness.

@luisbg
Copy link
Contributor Author

luisbg commented Apr 5, 2013

Tested this on Fedora 18. Works great Jack! Thanks :)

mrobinson pushed a commit to mrobinson/skia that referenced this pull request Nov 18, 2014
TSAN shows us racing on the function pointers.  Might as well fix it.

WARNING: ThreadSanitizer: data race (pid=19995)
  Read of size 8 at 0x7f703affb048 by thread T12 (mutexes: write M2957):
    #0 SkBitmap::internalErase(SkIRect const&, unsigned int, unsigned int, unsigned int, unsigned int) const /var/scratch/Release/../../../usr/local/google/home/mtklein/skia/src/core/SkBitmap.cpp:886 (tests+0x0000003511ca)
    servo#1 SkBitmap::eraseARGB(unsigned int, unsigned int, unsigned int, unsigned int) const /var/scratch/Release/../../../usr/local/google/home/mtklein/skia/src/core/SkBitmap.cpp:919 (tests+0x0000003534bf)
    servo#2 (anonymous namespace)::DecodingImageGenerator::getPixels(SkImageInfo const&, void*, unsigned long) /var/scratch/Release/../../../usr/local/google/home/mtklein/skia/src/images/SkDecodingImageGenerator.cpp:195 (tests+0x00000051bee1)
    servo#3 SkDiscardablePixelRef::onNewLockPixels(SkPixelRef::LockRec*) /var/scratch/Release/../../../usr/local/google/home/mtklein/skia/src/lazy/SkDiscardablePixelRef.cpp:63 (tests+0x00000039ad9c)
    servo#4 SkPixelRef::lockPixels(SkPixelRef::LockRec*) /var/scratch/Release/../../../usr/local/google/home/mtklein/skia/src/core/SkPixelRef.cpp:179 (tests+0x0000003fec23)
    servo#5 SkBitmap::lockPixels() const /var/scratch/Release/../../../usr/local/google/home/mtklein/skia/src/core/SkBitmap.cpp:414 (tests+0x00000034e41e)
    servo#6 SkAutoLockPixels /var/scratch/Release/../../../usr/local/google/home/mtklein/skia/include/core/SkBitmap.h:819 (tests+0x0000002752f3)
    servo#7 ImageDecoderOptions(skiatest::Reporter*) /var/scratch/Release/../../../usr/local/google/home/mtklein/skia/tests/ImageDecodingTest.cpp:565 (tests+0x000000275d03)
    servo#8 skiatest::Test::run() /var/scratch/Release/../../../usr/local/google/home/mtklein/skia/tests/Test.cpp:107 (tests+0x0000002263e7)
    servo#9 SkTestRunnable::run() /var/scratch/Release/../../../usr/local/google/home/mtklein/skia/tests/skia_test.cpp:108 (tests+0x0000001d8607)
    servo#10 SkThreadPoolPrivate::ThreadLocal<void>::run(SkTRunnable<void>*) /var/scratch/Release/../../../usr/local/google/home/mtklein/skia/include/utils/SkThreadPool.h:108 (tests+0x0000001d817e)
    servo#11 thread_start(void*) /var/scratch/Release/../../../usr/local/google/home/mtklein/skia/src/utils/SkThreadUtils_pthread.cpp:66 (tests+0x000000604347)

  Previous write of size 8 at 0x7f703affb048 by thread T26:
    [failed to restore the stack]


BUG=skia:1792
R=bungeman@google.com, mtklein@google.com, reed@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/250503003

git-svn-id: http://skia.googlecode.com/svn/trunk@14548 2bbb7eff-a529-9590-31e7-b0007b416f81
mrobinson pushed a commit to mrobinson/skia that referenced this pull request Nov 19, 2014
TSAN shows us racing on the function pointers.  Might as well fix it.

WARNING: ThreadSanitizer: data race (pid=19995)
  Read of size 8 at 0x7f703affb048 by thread T12 (mutexes: write M2957):
    #0 SkBitmap::internalErase(SkIRect const&, unsigned int, unsigned int, unsigned int, unsigned int) const /var/scratch/Release/../../../usr/local/google/home/mtklein/skia/src/core/SkBitmap.cpp:886 (tests+0x0000003511ca)
    servo#1 SkBitmap::eraseARGB(unsigned int, unsigned int, unsigned int, unsigned int) const /var/scratch/Release/../../../usr/local/google/home/mtklein/skia/src/core/SkBitmap.cpp:919 (tests+0x0000003534bf)
    servo#2 (anonymous namespace)::DecodingImageGenerator::getPixels(SkImageInfo const&, void*, unsigned long) /var/scratch/Release/../../../usr/local/google/home/mtklein/skia/src/images/SkDecodingImageGenerator.cpp:195 (tests+0x00000051bee1)
    servo#3 SkDiscardablePixelRef::onNewLockPixels(SkPixelRef::LockRec*) /var/scratch/Release/../../../usr/local/google/home/mtklein/skia/src/lazy/SkDiscardablePixelRef.cpp:63 (tests+0x00000039ad9c)
    servo#4 SkPixelRef::lockPixels(SkPixelRef::LockRec*) /var/scratch/Release/../../../usr/local/google/home/mtklein/skia/src/core/SkPixelRef.cpp:179 (tests+0x0000003fec23)
    servo#5 SkBitmap::lockPixels() const /var/scratch/Release/../../../usr/local/google/home/mtklein/skia/src/core/SkBitmap.cpp:414 (tests+0x00000034e41e)
    servo#6 SkAutoLockPixels /var/scratch/Release/../../../usr/local/google/home/mtklein/skia/include/core/SkBitmap.h:819 (tests+0x0000002752f3)
    servo#7 ImageDecoderOptions(skiatest::Reporter*) /var/scratch/Release/../../../usr/local/google/home/mtklein/skia/tests/ImageDecodingTest.cpp:565 (tests+0x000000275d03)
    servo#8 skiatest::Test::run() /var/scratch/Release/../../../usr/local/google/home/mtklein/skia/tests/Test.cpp:107 (tests+0x0000002263e7)
    servo#9 SkTestRunnable::run() /var/scratch/Release/../../../usr/local/google/home/mtklein/skia/tests/skia_test.cpp:108 (tests+0x0000001d8607)
    servo#10 SkThreadPoolPrivate::ThreadLocal<void>::run(SkTRunnable<void>*) /var/scratch/Release/../../../usr/local/google/home/mtklein/skia/include/utils/SkThreadPool.h:108 (tests+0x0000001d817e)
    servo#11 thread_start(void*) /var/scratch/Release/../../../usr/local/google/home/mtklein/skia/src/utils/SkThreadUtils_pthread.cpp:66 (tests+0x000000604347)

  Previous write of size 8 at 0x7f703affb048 by thread T26:
    [failed to restore the stack]


BUG=skia:1792
R=bungeman@google.com, mtklein@google.com, reed@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/250503003

git-svn-id: http://skia.googlecode.com/svn/trunk@14548 2bbb7eff-a529-9590-31e7-b0007b416f81
nox pushed a commit to nox/skia that referenced this pull request Aug 12, 2016
@MerlinYu MerlinYu mentioned this pull request Sep 21, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.